git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
JGJan-Benedict Glaw <jbglaw@lug-owl.de>
Date
Jul 9, 2006, 16:24 UTC
Message-ID
<20060709162407.GV22573@lug-owl.de>
In-Reply-To
<86ejwuuba2.fsf@blue.stonehenge.com>
On Sun, 2006-07-09 07:02:13 -0700, Randal L. Schwartz <merlyn@stonehenge.com> wrote:
Show 14 quoted lines
> >>>>> "Michal" == Michal Rokos <michal.rokos@nextsoft.cz> 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@lug-owl.de    . +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));
Previous: Randal L. SchwartzNext: Junio C Hamano
Message 8 of 16 in “Using 'perl' in *.sh”
  1. Using 'perl' in *.shMichal Rokos, Jul 8, 2006
  2. Junio C HamanoJul 8, 2006
  3. Alex RiesenJul 9, 2006
  4. Jan-Benedict GlawJul 9, 2006
  5. Junio C HamanoJul 9, 2006
  6. Michal RokosJul 9, 2006
  7. Randal L. SchwartzJul 9, 2006
  8. Jan-Benedict GlawJul 9, 2006
  9. Junio C HamanoJul 9, 2006
  10. Jan-Benedict GlawJul 9, 2006
  11. Michal RokosJul 10, 2006
  12. Randal L. SchwartzJul 10, 2006
  13. Johannes SchindelinJul 10, 2006
  14. Randal L. SchwartzJul 10, 2006
  15. Yakov LernerJul 9, 2006
  16. Alex RiesenJul 9, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.