sending scripts to background using &&

Kaos

[H]ard|Gawd
Joined
Oct 14, 2003
Messages
1,328
Posting from my phone on the bus - just got to thinking...

can you send two scripts to the background even while using '&&'

example


$: ./script1 && ./script2 &

or would it be

$: ./script1 & && ./script2 &

I would think the first would be correct?
 
$: ./script1 && ./script2 &

That will just run script1, wait for it to return 0, then run script2 in the background. If you want to run both scripts serially in the background, this should do it:

Code:
( ./script1 && ./script2 ) &
 
Back
Top