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

Re: zsh portable script



On 2010-07-12 18:31:57 +0200, Joke de Buhr wrote:
> Just for the fun of it. An executable file without the #! line is correct 
> either. So just write:
> 
> ---------------------- file ----------------------
> [ -z "$ZSH_VERSION" ] && exec zsh -- "$0" ${1+"$@"}
> print "hello from zsh"
> --------------------------------------------------

Yes, however, in practice, providing a #! line should be better so
that editors can recognize the file as a shell script (there are
other ways, but probably less portable).

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)



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