News for hackers. Stuff that matters.
Re:Stupid Unix Tricks by majewsky on Thursday October 17, 2019 @11:15AM (#21282916)
I think this snippet needs some context. In all contexts that I can imagine, the first line should actually be

  if which jq &>/dev/null; then
    brew install jq
  fi
Re:Stupid Unix Tricks by playpause on Thursday October 17, 2019 @11:23AM (#21283013)
That seems more reasonable, but it's not what the author wrote. He precedes the snippet with "Don’t try to install things with brew if brew is not installed", so his intention does seem to be to swallow errors silently, which is definitely weird.
Re:Stupid Unix Tricks by pletnes on Thursday October 17, 2019 @02:41PM (#21285115)
He might want his .bashrc to work on both macos and linux.
Re:Stupid Unix Tricks by 00N8 on Thursday October 17, 2019 @10:31PM (#21288157)
IME .bashrc already doesn't work the same on OS X, though, so that's still a weird reason.
Re:Stupid Unix Tricks by zeroimpl on Thursday October 17, 2019 @10:50PM (#21288250)
Likely due to using the older version of bash preinstalled on Mac. Installing a new one and it should be virtually identical.