From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3587 invoked from network); 22 Sep 1999 08:58:54 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 Sep 1999 08:58:54 -0000 Received: (qmail 13637 invoked by alias); 22 Sep 1999 08:58:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7993 Received: (qmail 13630 invoked from network); 22 Sep 1999 08:58:37 -0000 Date: Wed, 22 Sep 1999 01:58:31 -0700 From: Clint Olsen To: zsh-workers@sunsite.auc.dk Subject: Re: #!/path/to/arch-indep/zsh -f Message-ID: <19990922015831.A82900@ichips.intel.com> References: <19990921182350.A45626@ichips.intel.com> <9909220759.AA12437@ibmth.df.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre1i In-Reply-To: <9909220759.AA12437@ibmth.df.unipi.it> Organization: Intel Corporation, Hillsboro, OR X-Disclaimer: Mutt Bites! On Sep 22, Peter Stephenson wrote: > > 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 Ok, I gave this a try. This doesn't seem to be my problem (this time). What's happening is that *csh is actually trying to run my script and immediately failing on the first apparent syntax error. It's as if it won't fire off the interpreter correctly: #!/afs/pdx/proj/otools/bin/zsh -f prog=${0##*/} ... ... ~% rlsci Missing }. As a test, I tried copying Perl to a directory of my own and running a test with a perl script thinking it might have something to do with me owning the interpreter. Evidently that's not it, either. If I eliminate the wrapper from the equation, it seems to work fine (but then it's not very portable). Thanks, -Clint