Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: #!/path/to/arch-indep/zsh -f
- X-seq: zsh-workers 7992
- From: Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>
- To: Clint Olsen <olsenc@xxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxxxxxxxxx (Zsh hackers list)
- Subject: Re: #!/path/to/arch-indep/zsh -f
- Date: Wed, 22 Sep 1999 09:59:25 +0200
- In-reply-to: "Clint Olsen"'s message of "Tue, 21 Sep 1999 18:23:51 DFT." <19990921182350.A45626@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Clint Olsen wrote:
> Hello:
>
> FYI, I'm using zsh-3.1.6.
>
> I decided to change my script to reflect the copy of my shell, and attempt
> to direct it to the path of my zsh wrapper itself causes the script to
> misfire when it is executed from *csh. I've narrowed it down to a machine
> independent wrapper I have which seems to be hampering starting the
> interpreter. It is:
>
> #!/bin/sh
>
> if [ -f $OTOOLS/bin/$OS/zsh ]; then
> exec $OTOOLS/bin/$OS/zsh $*
> else
> exec /usr/intel/bin/zsh $*
> fi
Well, a more specific test would be `[ -x $OTOOLS/bin/$OS/zsh ]', but if
the file's there, it's likely to be executable. A more likely source of
problems, particularly if you are passing arguments with spaces in, in
which case it's a guaranteed source of problems, is our old friend the sh
word-splitting behaviour: for example, if you do
zsh -c 'echo "hello there"'
the wrapper will actually in effect invoke
zsh -c 'echo' '"hello' 'there"'
(which is bad). To keep your arguments intact, try:
#!/bin/sh
if [ -x $OTOOLS/bin/$OS/zsh ]; then
exec $OTOOLS/bin/$OS/zsh "$@"
else
exec /usr/intel/bin/zsh "$@"
fi
--
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
Messages sorted by:
Reverse Date,
Date,
Thread,
Author