Re:Show HN: New unix utility "when"
by apgwoz on Wednesday December 11, 2013 @11:18AM
(#6888378)
I've so far only tested this on OS X, and have mostly used it with the `-t` mode to have it notify me (via "say") when ssh succeeds on a CloudFormation spawned AWS instance.
Re:Show HN: New unix utility "when"
by lipanski on Wednesday December 11, 2013 @11:50AM
(#6888659)
What's the difference between this and the bash '&&' operator? Except for the timebomb flag, I don't really see any difference. Please correct me if I got this wrong.
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: someone else just posted about watch[1], never knew that existed before today. You learn something new every day :D
[1] https://news.ycombinator.com/item?id=6888640
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.
It defaults to the until behavior because it's most common.