From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22921 invoked by alias); 12 Jul 2010 16:32:19 -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: 15178 Received: (qmail 10415 invoked from network); 12 Jul 2010 16:32:08 -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 autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at seiken.de designates 94.23.38.107 as permitted sender) From: Joke de Buhr To: zsh-users@zsh.org Subject: Re: zsh portable script Date: Mon, 12 Jul 2010 18:31:57 +0200 User-Agent: KMail/1.13.2 (Linux/2.6.32-22-generic; KDE/4.4.2; x86_64; ; ) References: <1007130241570.5546@smasher> <20100712161519.GO1499@prunille.vinc17.org> <20100712161852.GY1341@prunille.vinc17.org> In-Reply-To: <20100712161852.GY1341@prunille.vinc17.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3207701.Ms7COZL4Si"; protocol="application/pgp-signature"; micalg=pgp-ripemd160 Content-Transfer-Encoding: 7bit Message-Id: <201007121831.59775.joke@seiken.de> --nextPart3207701.Ms7COZL4Si Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Monday 12 July 2010 18:18:52 Vincent Lefevre wrote: > On 2010-07-12 18:15:19 +0200, Vincent Lefevre wrote: > > On 2010-07-12 17:45:18 +0200, Joke de Buhr wrote: > > > sorry, the correct version should be: > > > #!/bin/sh > > > =20 > > > if [ -z "$ZSH_VERSION" ]; then > > > =20 > > > ## searching PATH for zsh executable > > > exec zsh $0 $* > >=20 > > As arguments may contain spaces, this is incorrect. This should be: > > exec zsh "$0" ${1+"$@"} >=20 > Sorry, >=20 > exec zsh -- "$0" ${1+"$@"} >=20 > as I said in my previous reply. Just for the fun of it. An executable file without the #! line is correct=20 either. So just write: =2D--------------------- file ---------------------- [ -z "$ZSH_VERSION" ] && exec zsh -- "$0" ${1+"$@"} print "hello from zsh" =2D------------------------------------------------- --nextPart3207701.Ms7COZL4Si Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQG7BAABAwAlBQJMO0N+Hhhoa3A6Ly9wb29sLnNrcy1rZXlzZXJ2ZXJzLm5ldAAK CRCWUloJhwFWxvFuC/4utlA2HvZetZeTMOt0Jjl9BH/tMthm6zKb6FWtkPbcSLiq cvXkpS/cpSeNAuU6NvE84PLpZEvzjACBNcgN6xTWUF9lwcm2/QvjDsuSgu5oeCfu uXQw8SnIq8S6PHIZYH62/MiQdz1xsDv42hJAyEimSjQUf0rxTIPQj+rwMsJOh8jM DIVyQ0BWWGXZL865gYRvz2cRYuuBmkF3BvvsrI9F/xjFrfpUAAPP1rLFADFC8z9G JBhx5k+Ae4ApR8p54MmJH1aMWHa2wsg1BV2FXohnygH8k8oJaWVYmmssII0qu94U 4OmjStPk3ZR/qC1pyD5tMFhFk94JznaITnhu+oE5vuNHo6qNKWioJQK4eLyGrUgv qd8U2tKc0K80+6Pzm9N9H+/oDT8Pa42PQiWj+ZsA7/fAKaKvavHc/XPf5JIWr2AD 5dMWc6rnY2ffLbLJm5F6pBllgXqNxSZWsn7spE5hfxoqhhc+gknCAT3sP38aSFfP B1/ZVMk8fd8fesY2HxE= =k9I7 -----END PGP SIGNATURE----- --nextPart3207701.Ms7COZL4Si--