Script partially executes??

Hi All,

I am calling a shell script from another shell script, however, it only executes part of it (the echo commands only). What could be some causes for that?

For example:

ShellScriptA.sh:

 
...
...
...
. ShellScriptB.sh

ShellScriptB.sh contents:

 
echo date
echo Connecting to database
sqlplus -S username/password << EOF - - - this point on is not executed.
select count(*) from test;
define exit_status = 0
exit &exit_status
EOF

However, when ShellScriptB.sh is executed independently it works just fine. Any ideas?

Thanks.

Without seeing the rest of ShellScriptB.sh we can't do anything but make wild guesses...

There. I have updated the script contents.

Please execute the calling script with xtrace and -v options enabled: -xv
and post the complete output here.

Note that there's a Subscribe to this thread option in the Thread Tools menu in the upper bar.

I am on HPUX so I'm guessing I would use strace instead?

No,
just run the parent script like this:

sh -xv /path/to/script_name

Where sh is the shell you're currently using.

I got it. I just needed to change directories to where the file was. That took care of it.

Thanks.