From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1269 invoked from network); 22 Sep 1999 08:42:15 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 Sep 1999 08:42:15 -0000 Received: (qmail 12453 invoked by alias); 22 Sep 1999 08:42:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7992 Received: (qmail 12444 invoked from network); 22 Sep 1999 08:42:00 -0000 Message-Id: <9909220759.AA12437@ibmth.df.unipi.it> To: Clint Olsen , zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: #!/path/to/arch-indep/zsh -f In-Reply-To: "Clint Olsen"'s message of "Tue, 21 Sep 1999 18:23:51 DFT." <19990921182350.A45626@ichips.intel.com> Date: Wed, 22 Sep 1999 09:59:25 +0200 From: Peter Stephenson 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 Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy