You might help a newbie like me, I am trying to run a .sh inside my shell script. After running that I need to execute below commands. Here's how my scripts looks like. Hope you can help:
#!/bin/sh
cd $ORACLE_HOME/owb/bin/unix
./OMBPlus.sh ---> goes to OMB+> directory
cd /app/mes_dwh/omb --> this needs to be executed while inside OMB+>
source execute_all.tcl --> need to be executed while inside OMB+>
exit ---> need to exit to execute another command
either a good path, relative or absolute, or have it in a directory in your $PATH,
it must have execute permissions to you, and
if it is a script, it needs a #! line with a good absolute path to the interpreter, and sometimes just one argument to make the interpreter happy, like -f for awk or sed.
I would recommend to use these paths inside their corresponding script, don't mess with the main script. When it comes to call multiple scripts inside a wrapper script, all requirements should be fulfilled inside the called-script and not in main wrapper script. what you are messing up here is that writing down then paths for called-scripts and then a call is sent to them.
try executing them in a normal way as you would be doing them on command lineby either either
sh does not need a -f like sed and awk, and in fact it affects globbing, -b is only effective interactively, when there is job control, but sometimes we put in a -x for debug to see what it is doing.
-f Disable pathname expansion.
-b Report the status of terminated background jobs immediately, rather than before the next primary prompt. This is effective only when job control is enabled.
The effect of first line $!xxxx is a new command: xxxx "$0" "$@"
The man page for sed and awk says to run a script file use -f, but for sh it says just put it on the command line.