in reply to Calling a shell script after changing directory
system($cmd) and die "command failed with code " . ($? >> 8).
Also, in order to chain several commands into a single shell call it is better to use && instead of the semicolon. That way, if some command fails, processing stops immediately.
$cmd = 'cd /home/folder1/folder2 && sh test1.sh';
|
|---|