Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh portable script
- X-seq: zsh-users 15179
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: zsh portable script
- Date: Mon, 12 Jul 2010 18:39:45 +0200
- In-reply-to: <B8515879-B7F7-460E-8E2B-48B3335E686B@xxxxxxxxxxx>
- 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> <201007121737.21296.joke@xxxxxxxxx> <201007121745.20332.joke@xxxxxxxxx> <20100712161519.GO1499@xxxxxxxxxxxxxxxxxxx> <B8515879-B7F7-460E-8E2B-48B3335E686B@xxxxxxxxxxx>
On 2010-07-12 18:22:22 +0200, Sebastian Stark wrote:
> Am 12.07.2010 um 18:15 schrieb Vincent Lefevre:
> > exec zsh "$0" ${1+"$@"}
exec zsh -- "$0" ${1+"$@"}
> is this something every POSIX-compatible bourne shell understands?
AFAIK, this works with both POSIX shells and traditional Bourne shells
(at least with the Bourne shell /bin/sh from Solaris).
Note that "$@" alone is not portable, as if there are no arguments,
some shells replace it by "" (any reference?). Hence the ${1+"$@"}.
--
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