On 2013-12-13, at 00:48, Samuel Holland wrote: > And if you only need simple messages, then there's nothing wrong with having > to > quote the "on success" command: > > $ when -t -c "xmessage Success" <command> <args...> > > The advantage of specifying the message command as an argument (as opposed to > &&) is that it allows you to pass through the return value of the main > command. > For example, if your long-running program is still running after the timeout, > you get the message; but it may fail later, and you want to know about that > too. > > $ when -t -c 'logger "Service started successfully"' non-forking-service || > logger "Service exited unexpectedly"
This. Not loosing exit code of child process in -t mode is a very good thing. In -z mode, -c "command" and && command will be equivalent. -Truls