From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22410 invoked by alias); 12 Jul 2010 16:39:49 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15179 Received: (qmail 17658 invoked from network); 12 Jul 2010 16:39:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Mon, 12 Jul 2010 18:39:45 +0200 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: zsh portable script Message-ID: <20100712163945.GQ1499@prunille.vinc17.org> Mail-Followup-To: zsh-users@zsh.org References: <1007130241570.5546@smasher> <201007121737.21296.joke@seiken.de> <201007121745.20332.joke@seiken.de> <20100712161519.GO1499@prunille.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.20-6084-vl-r35499 (2010-05-18) 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 - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)