From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1896 invoked from network); 9 Apr 2002 12:00:31 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 9 Apr 2002 12:00:31 -0000 Received: (qmail 23497 invoked by alias); 9 Apr 2002 12:00:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16951 Received: (qmail 23477 invoked from network); 9 Apr 2002 12:00:17 -0000 To: Akim Demaille , zsh-workers@sunsite.dk, ab@purdue.edu, bug-autoconf@gnu.org Subject: Re: Zsh 3 and ${1+"$@"} (Was: [GNU Autoconf 2.53] testsuite.log: 126 failures) In-reply-to: "Oliver Kiddle"'s message of "Tue, 09 Apr 2002 12:45:26 BST." <20020409114526.GA30136@logica.com> Date: Tue, 09 Apr 2002 12:59:48 +0100 Message-ID: <28811.1018353588@csr.com> From: Peter Stephenson Oliver Kiddle wrote: > One idea would be if you can use a global alias, e.g.: > [ x$ZSH_VERSION != x ] && alias -g '${1:"$@"}'='$=@' > > Is the ${1+"$@"} always used as a word on its own? The rhs of the alias > may have to be something different - I didn't entirely understand the > problem but you'd have the full flexibility of zsh 3.0.8 expansions so > I'd be suprised if it couldn't be made to work. Crikey, it works! I put '"$@"' on the right of the alias and it does the trick. This is 3.0.8. % setopt shwordsplit % [ x$ZSH_VERSION != x ] && alias -g '${1+"$@"}'='"$@"' % set 'one word' 'two words' % for arg in ${1+"$@"}; do echo $arg; done one word two words As Oliver says, you have to make sure you use *exactly* the form ${1+"$@"} and no other set of characters. But you have control over that, so putting [ x$ZSH_VERSION != x ] && alias -g '${1+"$@"}'='"$@"' at the top of the script may be just what you want. (As I said before, "$@" will work the way you want it.) -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************