4 ms·
if [ a = b ] || grep -q ^hello$ /usr/share/dict/words; then echo "test failed and grep succeeded" fi > “You pick whether to be amused or horrified. I
by hwc 3y ago
if [ a = b ] || grep -q ^hello$ /usr/share/dict/words; then
echo "test failed and grep succeeded"
fi
> “You pick whether to be amused or horrified. I don’t know how exactly my coworker reacted when I hinted at this during a recent code review I did for them.”
Isn't that normal everyday shell use?
- OJFord 3y agoThe only thing that might 'horrify' me in code review for that is the assumption that it only evaluates true when test failed. (And I might quote '^hello$' personally just on principle for having special chars, especially dollar, and to help syntax highlighters.)