3 ms·
Yeah that's when I use it too. I figure if I've already given into the temptations of Bash, I may as well go all the way. Sometimes if I'm feeling extra frisky
by chatmasta 3y ago
Yeah that's when I use it too. I figure if I've already given into the temptations of Bash, I may as well go all the way. Sometimes if I'm feeling extra frisky I even do [[ .. ]] || { echo "error!" ; exit 1 }
- cduzz 3y agoI imagine most people have sets of macros they habitually add to any sufficiently complex script they're modifying... yelp(){ es=$1 shift echo "$@" >&2 exit $es } test -d /tmp/goober || yelp 33 "couldn't find goober!" (yes, I'm sure there are standards for exit status ranges and 33 is not such a thing)