News for hackers. Stuff that matters.
Re:Use long flags when scripting by njharman on Monday February 04, 2013 @11:52AM (#5165171)
No a lot of stuff broke because people depended on implicit rather than being explicit.

    #!/bin/bash
Re:Use long flags when scripting by Wilya on Monday February 04, 2013 @12:16PM (#5165405)

  wilya@home $ /bin/bash
  zsh: no such file or directory: /bin/bash
  wilya@home $ which bash
  /usr/local/bin/bash
(Yes, I'm annoyed when I see #!/bin/bash, especially on scripts which are otherwise basic enough to be portable everywhere)
Re:Use long flags when scripting by dfox on Monday February 04, 2013 @12:31PM (#5165564)
It is still better to write #!/bin/bash for bashism using scripts than #!/bin/sh. I recently had to run sed -i (well, another GNUism) 1s%/sh%/bash% on bunch of customer's scripts to make them work on debian. At least when script wants /bin/bash it is going to fail cleanly (and not in the middle after modifying random things) and with mostly meaningful error.
Re:Use long flags when scripting by wollw on Tuesday February 05, 2013 @01:07AM (#5169426)
It's probably safer to use:

    #!/usr/bin/env bash
Assuming env is installed (I believe I had to install a package on OpenBSD to use it) this will find the first instance of bash in the PATH.
Re:Use long flags when scripting by atsaloli on Tuesday February 05, 2013 @01:25AM (#5169476)
How do you know env is in /usr/bin rather than in /bin or /usr/local/bin? I'm just curious...
Re:Use long flags when scripting by wollw on Tuesday February 05, 2013 @01:32AM (#5169495)
You don't, but I've run into more problems with bash being in unexpected places than env.
Re:Use long flags when scripting by atsaloli on Tuesday February 05, 2013 @05:03AM (#5169956)
Right on, thanks.
Re:Use long flags when scripting by ralph on Tuesday February 05, 2013 @08:25AM (#5170494)
Good question. I've used systems, e.g. AIX, where env(1) was in /bin.