mob/verb/dir2222 ()
shell(" cd /home/doniu ; && ls >> test.txt ")
Hello, i try to use shell, and go to xxx directory, ls it, and save the output. But it don't work, ^ that code, don't give any compile errors but just don't work
Code:
mob/verb/dir2222 () Hello, i try to use shell, and go to xxx directory, ls it, and save the output. But it don't work, ^ that code, don't give any compile errors but just don't work |
Nov 11 2015, 5:36 pm
|
|
Is the DD in trusted mode?
|
How did you fix it? The answer may help someone searching this forum in the future.
|
shell(" cd /home/doniu ; && ls >> test.txt ")
cd /home/doniu && ls ; - it should be never in that code |
You don't even need to use two commands.
shell("ls /home/doniu >> test.txt")
Will do the job. |
I kind of wonder. If you run shell("cd ...") and then run shell again, will it still be in the same directory or will the second shell just start at "./", the home directory of the server? Never bothered to use cd in shell(). I just did everything through direct paths.
|