Re: [Patch] Using 'perl' in *.sh

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

 



On Sun, 2006-07-09 07:02:13 -0700, Randal L. Schwartz <merlyn@xxxxxxxxxxxxxx> wrote:
> >>>>> "Michal" == Michal Rokos <michal.rokos@xxxxxxxxxxx> writes:
> 
> Michal> I have no problem with that. I can set $PATH.
> Michal> But then I'd suggest to change magic #!
> Michal> from #!/usr/bin/perl
> Michal> to #!/usr/bin/env perl
> Michal> for *.perl
> 
> Michal> It that what you meant?
> 
> No, don't do that.  Use the path to Perl that they chose during
> configuration because
> 
> (a) it might not be the first one in PATH

If you want to execute some binary that's not first in path, you'd
better *always* call that explicit.

> (b) even if it's the first one in *my* path, it might not be the
>     first one in *everyone's* path

Communication problem. Machine's administrator should offer a working
git installation. If a user chooses to build his own git, he'd better
make sure that all the environment is properly set-up, too.

> (c) env requires an *extra* fork/exec

Only an extra exec.

> (d) some systems don't have env

Huh? Show me a system that has no /usr/bin/env, but a working POSIX
shell in /bin/sh .

> The env hack is a nice hack, but it's just a hack.  Don't
> rely on it when the right thing is nearby.

What's the right thing? The right thing is to explicitely call the
interpreter, not using the shellbang at all.

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@xxxxxxxxxx    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]