From: "Benjamin R. Haskell" <zsh@benizi.com>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: zsh portable script
Date: Tue, 13 Jul 2010 17:08:42 -0400 (EDT) [thread overview]
Message-ID: <alpine.LNX.2.01.1007131651370.4808@hp.internal> (raw)
In-Reply-To: <20100713210106.6411aba8@pws-pc>
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
next prev parent reply other threads:[~2010-07-13 21:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1007130241570.5546@smasher>
[not found] ` <20100712170648.706cb975@csr.com>
2010-07-13 20:01 ` Peter Stephenson
2010-07-13 21:08 ` Benjamin R. Haskell [this message]
2010-07-14 10:33 ` 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=alpine.LNX.2.01.1007131651370.4808@hp.internal \
--to=zsh@benizi.com \
--cc=p.w.stephenson@ntlworld.com \
--cc=zsh-workers@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).