From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4902 invoked by alias); 20 Jul 2010 13:54:31 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15191 Received: (qmail 24181 invoked from network); 20 Jul 2010 13:54:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at m.gmane.org designates 80.91.229.12 as permitted sender) X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Thorsten Kampe Subject: Re: zsh portable script Date: Tue, 20 Jul 2010 15:53:50 +0200 Message-ID: References: <1007130241570.5546@smasher> <201007121737.21296.joke@seiken.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: nat.scz.novell.com User-Agent: MicroPlanet-Gravity/2.9.15 * 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