I need to run sequential shell commands using perl, but I need the shell environment to keep its variables.
for example:
$result = `cd /`;
$result = `touch test.txt`;
In this example, I need test.txt to be created on /.
Also, I don't want to run them in one line code like $result=touch /test.txt
; I need seperate calls to shell while environment variables remain the same.
bash -c 'cd /'
to do anything useful? – Brad Gilbert Apr 3 at 14:30bash -c 'cd /'
does not do anything useful. It creates a sub-shell that sets it's working directory, that then returns an errorlevel of 0. When it's done you have the same working directory that you started out with. The only thing it can do, is find out if the directory exists. – Brad Gilbert Apr 3 at 18:46