Show HN: New unix utility "when"
github.com
github.com
while true; do echo "hello world"; sleep 3; done
While that above code is pretty trivial to type, having a utility to this would be a great time saver for the lazy sysadmin :)edit: someone else just posted about watch[1], never knew that existed before today. You learn something new every day :D
The '&&' operator, as in which ruby && echo 'found it!', triggers the second command, if the exit code of the first one is 0.
Also good to note, the '||' operator triggers the second command only if the exit code of the first one is different than 0. As in which ruby123456 || echo 'could not find it!'.
EDIT: typo.
until cmd1 ; do sleep 1 ; done ; cmd2It defaults to the until behavior because it's most common.