How do I execute a batch command from a script, which "waits" with the next command until the first one has finished?
=======
A piece of my script looks like this:
#!/bin/sh
(...)
# run a long batch job:
./run_calculation.sh
# then rename resulting file:
mv output.dat backup.dat
(...)
=======
and the problem is that "mv" command executes BEFORE "run_calculation.sh" has finished!
Thank you guys; however, none of these things seem to work
(1)
"batch <<EOF..." and "wait" commands both produce the same message:
"Can't open /var/run/atd.pid to signal atd. No atd running?"
(2)
Placing "&&" after the executable name has no (desired) effect, whether the next command goes in the same or next line.
instead of enabling stuff nor causing yourself all this bother why not just edit run_calculation.sh and add at the bottom 'mv output.dat backup.bat' at the bottom?
This is what I've done and it works.
The reason for this whole hassle was that it is a part of a loop.
But I put the contents of my calculation batch script into the main script, and it seems OK.
Thanks
Ivo
PS.
Noe it looks like that:
(...)
for ((j=1; j<=$5; j++))
do
update_parameters < __inp000000__
done