help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Usr/bin/env


From: Greg Wooledge
Subject: Re: Usr/bin/env
Date: Sat, 14 Aug 2021 09:23:14 -0400

On Sat, Aug 14, 2021 at 01:48:57PM +0200, Julius Hamilton wrote:
> At the top of a script I see "#!/usr/bin/env sh".

Sounds like someone wanted to ensure that their script ran under a POSIX
shell on Solaris, back in the days when Solaris was still shipping
a Bourne shell as /bin/sh.  Of course, this shebang alone would not have
been enough to ensure it -- the caller's PATH variable would also have
to have been set correctly.

Either that, or the author was simply weird.

My personal suggestion would be to use #!/bin/sh and if you ever run
the script on older versions of Solaris and it breaks, edit the shebang
to point to a better shell.  Of course, this suggestion only works if
you're the person using the script, or if the person using the script
is known to be competent enough to edit it.  If you're distributing a
script for Solaris users who are not competent, you may have to jump
through hoops.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]