My run.sh script errors out when I try to run another script in the background..
Console Error String
./run.sh 30: nohup bash /export/home/myself/bin/mytestprogram &>/dev/null & : No such file or directory
- can't publish the script because its host machine isn't on the internet.
here is what works
it builds an absolute path to the target program..
such as: Absolute Path to target script
/export/home/myself/bin/mytestprogram
which runs fine manually or through the script... It builds this command line with script variables like so
Bash Script how I build the command string
cmd="${exedir}/${exe}"
and I run this from my script by saying
Bash Script line which Calls the Target command string
"${cmd}"
all that works.. So running the script in the foreground works.
Now what doesn't work, when I try to run the exact same path and command in the background.
I am trying to run:
Run in Background Command String
nohup bash /export/home/myself/bin/mytestprogram &>/dev/null &
which works when I manually past it from the output of my script to the command line. When I manually call this on the command line, it works. My script actually echo's the command to the console and I cut and past it and it works. But when the run.sh script calls same command, it doesn't work?
I build this with the same variables as the above foreground call like so..
How the Background Command String is built
cmd="nohup bash ${exedir}/${exe} &>/dev/null &"
I echo this command to the console like so:
How Background Command String is sent to Console
echo -e "$cmd"
and call it like so..
"$cmd"
again my error message is:
Console Error String
./run.sh 30: nohup bash /export/home/myself/bin/mytestprogram &>/dev/null &
:No such file or directory
Any thoughts?