Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh portable script
- X-seq: zsh-users 15191
- From: Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: zsh portable script
- Date: Tue, 20 Jul 2010 15:53:50 +0200
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <1007130241570.5546@smasher> <201007121737.21296.joke@xxxxxxxxx>
* Joke de Buhr (Mon, 12 Jul 2010 17:37:19 +0200)
> On Monday 12 July 2010 16:46:22 Atom Smasher wrote:
> > on freebsd, zsh installs as /usr/local/bin/zsh. on linux (and most
> > other systems?) it installs as /usr/bin/zsh.
> >
> > what's the best way to make zsh script portable between linux and
> > freebsd?
> >
> > i could start the script with:
> > #!/usr/bin/env zsh
> >
> > or i could specify that the script be executed as:
> > zsh script
> >
> > is there a better way?
>
> Using env doesn't solve the problem either. There is no guarantee the "env"
> program is installed under /usr/bin/env.
It does solve the problem that's why it's used in (shell) scripting[1].
For Python for example it's the official way to specify the interpreter.
I don't think "Atom Smasher" need a "guarantee" - just a confirmation
that it does indeed work.
Thorsten
[1] http://en.wikipedia.org/wiki/Env
Messages sorted by:
Reverse Date,
Date,
Thread,
Author