views:

52

answers:

3

Hi all,

This may be a rudimentary question but the answer was not readily available.

I'd like to create a shell script that calls 3 tasks consecutively, but wait till the previous task is complete.

Like so:

a. call first Java program via ant b. call third party Java application c. call third Java program via ant

I'm wondering if there is a way to check and ensure a. is done before b. is called and same for b. and c.

thanks

+1  A: 

By default ant tasks happen in the foreground, so your script won't continue until each ant task has finished. You only need to mess with things if you want the opposite behavior: all three tasks happening simultaneously

Michael Mrozek
Thanks Micheal, I'll try and report back.
Bigtwinz
A: 
java some.package

if [ $? -ne 0 ]; then exit -1; fi;

java some.other.package

By default calls inside the script are consecutive. If the first java execution 'some.package' doesn't return 0, the normal exit code, the script will exit with -1 without executing 'some.other.package'

lemotdit
A: 
bunting