in reply to Calling a shell script after changing directory
system 'sh /home/folder1/folder2/test1.sh';
But you are doing something very wrong, which is the cause of your error: system($cmd) or die "none"
Infact system is not like open from the docs:
The return value is the exit status of the program as returned by the wait call. To get the actual exit value, shift right by eight (see below). See also exec.
system sets $? and if you need to inspect the returned status you need something like this (again from the docs):
if ($? == -1) { print "failed to execute: $!\n"; } elsif ($? & 127) { printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; } else { printf "child exited with value %d\n", $? >> 8; }
L*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calling a shell script after changing directory
by Gouravhere (Initiate) on May 11, 2016 at 07:17 UTC | |
by Discipulus (Canon) on May 11, 2016 at 07:37 UTC |