Page 1 of 1

How to execute more commands in the Before/After Job routine

Posted: Tue Jun 27, 2006 1:41 pm
by Shree0410
Hi all,

If I want to execute multiple commands on the Before or the After job routines, for example if I want to execute 2 commands in the before job routine like 'delete a file from a directory' and also cat 2 or 3 files to make a single file, how can I do this.

thanks guyz

Posted: Tue Jun 27, 2006 1:45 pm
by DSguru2B
Build a small script for that and fire that script from the before/after job subroutine section using ExecSh

Posted: Tue Jun 27, 2006 1:51 pm
by Shree0410
Thanks a lot, but I am not allowed to write my own scripts without the prior approval, so i am trying to find a way to execute multiple commands from the job parameters.

Posted: Tue Jun 27, 2006 1:53 pm
by chulett
Then put a semi-colon between the commands.

Posted: Tue Jun 27, 2006 4:32 pm
by ray.wurlod
Learn about operating system pipelining. In summary:

Code: Select all

command1 ; command2
command2 is executed unconditionally after command1 finishes

Code: Select all

command1 && command2
command2 is executed only if command1 finishes successfully (with an exit status of 0)

Code: Select all

command1 !! command2
command2 is executed only if command1 finishes unsuccessfully (with an exit status of other than 0)