2

I'd like to run the following commands in parallel with 1 shell script.

coffee -wc lib/
coffee -wcb public/

Currently, I have to press ctrl+c to cancel out of the first one before the second line can execute.

Any ideas would be greatly appreciated!

1 Answers1

1

This will run both simultaneously.

   # coffee -wc lib/ && coffee -wcb public/

UPDATE: As per Dennis and Neurolysis's comment, I'm changing the answer to use an &. Although both commands are similar, the && operator will cause the 2nd command to be run only after the first is completed.

 ## print 'program1', wait 4 seconds, print 'program2'
 # echo 'program1';sleep 4 && echo 'program2'

 ## print 'program1' and sleep, but also simulatneously print 'program2'
 # echo 'program1';sleep 4 & echo 'program2'

Thus, the technically correct answer is:

 # coffee -wc lib/ & coffee -wcb public/
jmort253
  • 1,406