Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    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?



The 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.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: