Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh portable script
- X-seq: zsh-users 15194
- From: François Revol <revol@xxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: zsh portable script
- Date: Tue, 20 Jul 2010 16:07:32 +0200
- In-reply-to: <i249q3$jk3$1@xxxxxxxxxxxxxxx>
- 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> <i249q3$jk3$1@xxxxxxxxxxxxxxx>
Le 20 juil. 2010 à 15:53, Thorsten Kampe a écrit :
> * 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].
No it does not.
BeOS never had any /usr.
Haiku doesn't either.
It's just used because people "saw" env being put there more often than python or perl of whatever, but it doesn't mean they looked to all possible places.
It has just more chances of working but it's not a guarantee.
> For Python for example it's the official way to specify the interpreter.
Being official doesn't mean it's correct or works.
> I don't think "Atom Smasher" need a "guarantee" - just a confirmation
> that it does indeed work.
Again, it won't on Haiku and likely others.
François.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author