zsh-users
 help / color / mirror / code / Atom feed
From: "François Revol" <revol@free.fr>
To: zsh-users@zsh.org
Subject: Re: zsh portable script
Date: Tue, 20 Jul 2010 16:07:32 +0200	[thread overview]
Message-ID: <305645C3-6FF2-4D54-AC28-372D60283E07@free.fr> (raw)
In-Reply-To: <i249q3$jk3$1@dough.gmane.org>


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.

  reply	other threads:[~2010-07-20 14:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-12 14:46 Atom Smasher
2010-07-12 15:35 ` Sebastian Stark
2010-07-12 16:10   ` Joke de Buhr
2010-07-12 16:17   ` Vincent Lefevre
2010-07-12 15:37 ` Joke de Buhr
2010-07-12 15:45   ` Joke de Buhr
2010-07-12 16:01     ` Frank Terbeck
2010-07-12 16:15     ` Vincent Lefevre
2010-07-12 16:18       ` Vincent Lefevre
2010-07-12 16:31         ` Joke de Buhr
2010-07-12 16:43           ` Vincent Lefevre
2010-07-12 16:22       ` Sebastian Stark
2010-07-12 16:39         ` Vincent Lefevre
2010-07-12 16:47           ` Frank Terbeck
2010-07-13 13:02       ` Atom Smasher
2010-07-13 14:29         ` Benjamin R. Haskell
2010-07-13 15:28           ` Atom Smasher
2010-07-13 17:01             ` Benjamin R. Haskell
2010-07-14  1:11               ` Atom Smasher
2010-07-14 11:45           ` Atom Smasher
2010-07-14 15:00             ` Atom Smasher
2010-07-13 13:43   ` François Revol
2010-07-20 14:01     ` Thorsten Kampe
2010-07-20 14:13       ` François Revol
2010-07-20 13:53   ` Thorsten Kampe
2010-07-20 14:07     ` François Revol [this message]
2010-07-21  8:34       ` Thorsten Kampe
2010-07-12 15:37 ` Vincent Lefevre
2010-07-12 16:06 ` Peter Stephenson

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=305645C3-6FF2-4D54-AC28-372D60283E07@free.fr \
    --to=revol@free.fr \
    --cc=zsh-users@zsh.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).