[lsb-discuss] /usr/bin/env bash
Mark Hatle
mhatle at mvista.com
Tue Aug 17 10:27:07 PDT 2004
Ignoring the Unix specification issues...
We use "#! /usr/bin/env bash" extensivly in our products. Why? because
we have absolutly no idea where on the system the user has installed bash.
By using /usr/bin/env bash, we ensure that bash is run based on the
users environment and not some hard coded (somewhat arbitrary location).
Same could be said for /bin/sh.
(while not speaking of the LSB.. on things like Solaris and other Unix
(and Unix like) systems we support, /bin/sh is often barely usable as a
shell.. which is the primary reason we use the /usr/bin/env bash
trick... (after of course we have provided a bash to the environment...
or at least verified there is one available.)
--Mark
George Kraft wrote:
> If I remember correctly the UNIX specifications avoid specifying lines
> like "#!/bin/sh" at the beginning of a shell script. Is "/usr/bin/env" a
> solution to this problem?
>
> http://www.research.att.com/sw/tools/uwin/man/man1/env.html
>
> George (gk4)
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> lsb-discuss mailing list
> lsb-discuss at mail.freestandards.org
> http://mail.freestandards.org/mailman/listinfo/lsb-discuss
More information about the lsb-discuss
mailing list