/usr/local/bin in $PATH in system scripts?

Micah Cowan micahcowan at ubuntu.com
Fri May 11 03:58:47 UTC 2007

Ming Hua wrote:
> On Thu, May 10, 2007 at 08:33:41PM -0700, Micah Cowan wrote:
>> Ming Hua wrote:
>>> For the sake of discussion, I think
>>> #!/usr/bin/env perl
>>> will pick up $PATH and is a valid #! line.  I also believe this is widely
>>> used.
>> Yes, it will. But isn't that a somewhat silly suggestion considering the
>> context? If /usr/bin/perl were "bad" then /usr/bin/env would be just as
>> "bad", it seems to me...
> That's not the point.
> Fergal's argument is, if you think scripts honoring the $PATH variable
> and use the binaries /usr/local/bin/ is a feature because it respects
> the user preference, you should also think using "#!/usr/bin/env perl"
> instead of "#!/usr/bin/perl" a feature as well, for the same reason.
> And I think it's a valid argument.

But why should it apply to perl and not to env? What if you have a
broken env in /usr/local/bin?

I actually thing that /usr/bin/env is probably preferable, though: but
/usr/bin/perl has too strong a tradition behind it. I have noticed that
a decent number of python programmers do it that way.

I actually see both sides of the argument. Perhaps there should be a
single location for a base "restricted path" to be stored, and
modifications would be made from that, if necessary. I would probably
agree that /usr/local/bin shouldn't be in there by default.

Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-devel-discuss/attachments/20070510/8d0a6d78/attachment.sig>

More information about the Ubuntu-devel-discuss mailing list