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

Re: zsh portable script



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