From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10274 invoked by alias); 13 Jul 2010 21:09:24 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28074 Received: (qmail 1874 invoked from network); 13 Jul 2010 21:09:12 -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 benizi.com designates 64.130.10.15 as permitted sender) Date: Tue, 13 Jul 2010 17:08:42 -0400 (EDT) From: "Benjamin R. Haskell" To: Peter Stephenson cc: Zsh Hackers' List Subject: Re: zsh portable script In-Reply-To: <20100713210106.6411aba8@pws-pc> Message-ID: References: <1007130241570.5546@smasher> <20100712170648.706cb975@csr.com> <20100713210106.6411aba8@pws-pc> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 13 Jul 2010, Peter Stephenson wrote: > On Mon, 12 Jul 2010 17:06:48 +0100 Peter Stephenson wrote: > > Looking at the responses, on which I can't improve, one might > > speculate it was time for someone to implement path searching down > > in the #! handler for relative paths. > >... > > This doesn't really touch zsh except that we could do it in our own > > #! handler (see zexecve() in Src/exec.c).w > > Straightforward, not sure if anyone's interested since this only > addresses a fairly tiny part of the problem... > > Note if zsh is in the current directory it tries that first. That > maintains compatibility with how it used to work (whether > intentionally or not). > > % cat execme > #!zsh -f > print I am running under $ZSH_VERSION > % PATH=/bin ./execme > I am running under 4.3.10 > % PATH=/usr/local/bin ./execme > I am running under 4.3.10-dev-1 I don't quite understand... what does this improve? Doesn't the script already have to be running under Zsh for this to have any effect? How do most systems handle basenames in shebangs? Using the same set of shells that I was using to test the weird-numbers-of-backslashes thing that came up not too long ago, only the decidedly non-standard psh, sash, and shish don't completely barf on it. And even those three don't use it: zsh$ cat test.script #!zsh -f print ZSH_VERSION $ZSH_VERSION zsh$ for l in {ba,z,c,tc,,k,fi,p,da,mk,sa,shi,po}sh ; $l -c ./test.script && echo ok $l || echo nok $l nok bash nok zsh nok csh nok tcsh nok sh nok ksh nok fish ok psh nok dash nok mksh ok sash ok shish nok posh zsh$ for l in {p,sa,shi}sh ; $l -c ./test.script Error - Could not exec /home/bhaskell/tmp/testshebang/test.script. [1] Error 20533 ./test.script ./test.script: No such file or directory shish: shish: ./test.script: Success