Since the script executes 3 commands in succession on OS X but cares about the ending signal, it can fail, that's what the && means: execute next command only if the command on the left side finished problemlessly, so I'd replace them with ; to make the commands execute in order regardless of what.
Of course, the same applies to any other single line of commands, so always use ; rather than && unless you -know- the next command must execute only if the previous one succeeds. Be warned that I read that the precedence of && and || (execute next only if previous one fails) isn't same, so running a pseudocode like
quit && kill || echo
means
quit AND kill IF quit SUCCEEDS, OTHERWISE kill AND echo
Since the script executes 3 commands in succession on OS X but cares about the ending signal, it can fail, that's what the
&&
means: execute next command only if the command on the left side finished problemlessly, so I'd replace them with;
to make the commands execute in order regardless of what.Of course, the same applies to any other single line of commands, so always use
;
rather than&&
unless you -know- the next command must execute only if the previous one succeeds. Be warned that I read that the precedence of&&
and||
(execute next only if previous one fails) isn't same, so running a pseudocode likemeans