Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh portable script
- X-seq: zsh-users 15180
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: zsh portable script
- Date: Mon, 12 Jul 2010 18:43:15 +0200
- In-reply-to: <201007121831.59775.joke@xxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-followup-to: zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <1007130241570.5546@smasher> <20100712161519.GO1499@xxxxxxxxxxxxxxxxxxx> <20100712161852.GY1341@xxxxxxxxxxxxxxxxxxx> <201007121831.59775.joke@xxxxxxxxx>
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