git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Greaves <david@dgreaves.com>
To: Philip Pokorny <ppokorny@mindspring.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Why /usr/bin/env in scripts
Date: Mon, 25 Apr 2005 10:42:45 +0100	[thread overview]
Message-ID: <426CBB95.9040203@dgreaves.com> (raw)
In-Reply-To: <426C9E63.4050907@mindspring.com>

Philip Pokorny wrote:
> I notice that the first line of the pasky shell scripts is
> 
> #!/usr/bin/env bash

> So what am I missing?  Is this a portability aid?
man env:

The first remaining argument specifies the program name to invoke;
it is searched for according to the `PATH' environment variable.  Any
remaining arguments are passed as arguments to that program.

It's a trick to do a PATH search for a script interpreter rather than 
hard coding the path.
Now all we have to do is make sure every distro on the planet has 
/usr/bin/env - and they do.

David

  reply	other threads:[~2005-04-25  9:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-25  7:38 Why /usr/bin/env in scripts Philip Pokorny
2005-04-25  9:42 ` David Greaves [this message]
2005-04-25 17:45 ` David A. Wheeler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=426CBB95.9040203@dgreaves.com \
    --to=david@dgreaves.com \
    --cc=git@vger.kernel.org \
    --cc=ppokorny@mindspring.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).