in reply to Calling a shell script after changing directory
Hi Gouravhere,
You could use chdir to change the directory before executing the script, or perhaps File::pushd to easily restore the original working directory.
However, are you sure your script is failing? Have a look at the documentation of system for its return value and error handling: the convention is that an exit code of zero means success, so if your test1.sh follows this convention (which I'd strongly recommend), then the correct way to check for errors is system(@args) == 0 or die ....
Hope this helps,
-- Hauke D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calling a shell script after changing directory
by Gouravhere (Initiate) on May 11, 2016 at 07:05 UTC | |
by salva (Canon) on May 11, 2016 at 07:19 UTC | |
by Gouravhere (Initiate) on May 11, 2016 at 08:39 UTC | |
by salva (Canon) on May 11, 2016 at 09:41 UTC | |
by Gouravhere (Initiate) on May 11, 2016 at 10:01 UTC |