Subject: Re: newbies questions
From: (Rob Warnock)
Date: Wed, 04 Apr 2007 21:30:50 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Pascal Bourguignon  <> wrote:
| Can a shell script be an interpreter for a shell script?
| It doesn't look like it's possible: the interpreter of the
| "interpreter" script is used to interpret the script in the
| "interpreter" script language...
| A solution could be to use a shell script compiler, or to
| use a little bootstrap program.

My favorite such trampoline is the "env" program.
As it says in the FreeBSD man page:

    "env" is sometimes useful with the ``#!'' construct (see execve(2)).
    The only difference between "#!/usr/local/bin/foo" and
    "#!/usr/bin/env /usr/local/bin/foo" is that the latter works
    even if /usr/local/bin/foo is itself interpreted.  Using "env"
    this way also allows one to reference "foo" without the path,
    as well as set up the environment as desired.


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607