From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6222 invoked from network); 29 Jan 1997 09:00:33 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 29 Jan 1997 09:00:33 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id DAA18364; Wed, 29 Jan 1997 03:35:09 -0500 (EST) Resent-Date: Wed, 29 Jan 1997 03:12:50 -0500 (EST) Message-Id: <199701290814.JAA03482@hydra.ifh.de> To: zsh-users@math.gatech.edu (Zsh users list), Roderick Schertler Subject: Re: foo=($bar) vs foo=("$bar[@]") In-reply-to: "Roderick Schertler"'s message of "Wed, 29 Jan 1997 00:07:32 MET." <27155.854514452@eeyore.ibcinc.com> Date: Wed, 29 Jan 1997 09:14:24 +0100 From: Peter Stephenson Resent-Message-ID: <"m06hg3.0.RO4.2Qmxo"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/632 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Roderick Schertler wrote: > The NEWS file says > > foo=$bar no longer creates an array even if bar is an array. Use > foo=( $bar ) or even better, foo=( "$bar[@]" ) instead. > > In what way is "$bar[@]" better than $bar? I think the point is it works even if shwordsplit is set. % setopt shwordsplit % args() { echo $#; } % bar=('one word' 'another word') % args $bar 4 # i.e. 'one' 'word' 'another' 'word' % args "$bar[@]" 2 # i.e. 'one word' 'another word' It still doesn't quite make ksh users feel it home, it needs to be "${bar[@]}" for that. In fact, with ksharrays (or `emulate ksh') turned on you need it in zsh too, so perhaps the NEWS file ought to have that if it's trying to be all-inclusive. -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77413 Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.