New answers tagged

27 votes

Run two scripts after each other in the background? && and & don't work?

That's one of the known deviations¹ of zsh compared to sh (or csh for that matters). In sh: A && B & is short for: (A && B) & That is, it runs a subshell that runs that and-...
Stéphane Chazelas's user avatar
8 votes

Run two scripts after each other in the background? && and & don't work?

You have to group the two commands together: nohup sh -c 'a.sh; b.sh' & Replace ; with && if you want b.sh to run only if a.sh exits with success
Chris Davies's user avatar
0 votes
Accepted

How to pass the standard input of a shell script to a background command

Yes, that's an annoying requirement of the POSIX sh specification that commands started asynchronously by non-interative shell invocations (when the monitor option IOW job control is not enabled) have ...
Stéphane Chazelas's user avatar

Top 50 recent answers are included