[lsb-discuss] /usr/bin/env bash
Mark Brown
bmark at us.ibm.com
Tue Aug 17 11:12:11 PDT 2004
Mark Hatle writes:
> 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.
This still requires a specification of exec() that includes it knowing
what to
do with a file that starts with a "magic number" of "#!", and then how to
parse the following string...for example, having a whitespace char after
the "#!", is it really allowed? & etc. We found this hard to pin down
in POSIX/UNIXland.
But once you have that specified, you either have to define *exactly*
where
the "standard shell" is located on the FS, or do the same with "env".
-------------------
Mark S. Brown
STSM, UNIX/Linux OS Standards
IBM Systems Group, Linux Technology Center
bmark at us.ibm.com
More information about the lsb-discuss
mailing list