Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
foo=($bar) vs foo=("$bar[@]")
- X-seq: zsh-users 631
- From: Roderick Schertler <roderick@xxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: foo=($bar) vs foo=("$bar[@]")
- Date: Wed, 29 Jan 1997 00:07:32 -0500
- Sender: roderick@xxxxxxxxxx
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? The extra line noise is a
point in favor of the simpler form, what benefit outweighs it?
I hope it's not just that it makes ksh programmers feel at home! Being
able to say just $bar is one of zsh's big advantages in array handling.
--
Roderick Schertler
roderick@xxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author