Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple question about && 3

Status
Not open for further replies.

h3nd

Programmer
Jul 1, 2006
147
AU
Hi guys,

I have to process that need to be run simultaneously and I wanna put that process in the script

so if I put like this :
$ process1.ksh && process2.ksh

Are they gonna run simultaneously or process2 will run after process1 finish.

If not simultaneously, what should I do to make it so ?

Thx guys,
 
; terminator or newline runs commands sequentially:

cmd1
cmd2

is the same as

cmd1; cmd2


& terminator instead of ; or newline runs a cmd in background:

cmd1 & cmd2

cmd1 is run in background, then concurrently cmd2 is run


&& is "if OK then run:"

cmd1 && cmd2

&& separator runs a cmd2 if cmd1 runs OK


|| is "if not OK then run:"

cmd1 || cmd2

|| separator runs a cmd2 if cmd1 fails


HTH,

p5wizard
 
Thx guys,

especially for p5wizard for the great explanation.

Cheers,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top