Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: #!/path/to/arch-indep/zsh -f



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



Messages sorted by: Reverse Date, Date, Thread, Author