Essentially it is correct. For sleeping 5 seconds you need to call "sleep 5s" altough the number given to sleep is treated as second per default.

& is used to send each programm in the background prior launching the next programm.

I would only use && to chain the command sequence if it is likely that calling on program fails.

My version would look like this:

#!/bin/sh
/usr/bin/foo &
sleep 5s
/usr/bin/baar

Of course you could make this a bit more sophisticated by waiting for the process of /usr/bin/foo prior launching /usr/bin/baar.

HTH,
Holger

Reply via email to