0

I've got a bash script with a while loop that iterates over a list of directories. On each pass, it calls a perl script to do some work.

But on the first pass, whether the perl script exits successfully or with an error, the outer shell script exits too.

I've played with the bash trap command, and searched for an answer, but no solution yet. Thanks for any advice....

user214691
  • 11
  • 5

1 Answers1

4

Possibilities:

  1. The perl script isn't exiting with status 0 on success and set -e is in effect.
  2. The bash script is executing the perl script with exec
Mark Wagner
  • 18,019
  • 2
  • 32
  • 47
  • The shell script doesn't use `set -e` but I've explicitly tried `set +e` just before calling the perl script, and there's no difference. The shell script calls the perl script without any exec, ie: `/usr/local/bin/MyPerlScript MyParam1 MyParam2` – user214691 Jun 15 '16 at 16:47