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

Re: Can this be done with an array parameter?



DervishD wrote:
>     Anyway I'm still stunned by the first example I put, the
> assignment to the array in the form array=($array $newitem) Why Zsh
> quotes correctly? (I should define 'correctly' as 'the way I
> wanted'...).

I presume because you're sensible enough not to have sh_word_split set.
You could still do it as

array=("${array[@}" "$newitem")

which is what you'd have to do in bash.

By the way, in 4.1 you can now do

array+=($newitem)

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author