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

Re: Can this be done with an array parameter?



    Hi Peter :)

 * Peter Stephenson <pws@xxxxxxx> dixit:
> 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.

    When I first used Zsh, I had the option set, since I was more
familiar with that behaviour, but I unsetted it soon ;)

> array=("${array[@}" "$newitem")
> which is what you'd have to do in bash.

    And that was the notation I spected ;) I just didn't remember how
Zsh does word splitting ;)
 
> By the way, in 4.1 you can now do
> array+=($newitem)

    Nice!

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/



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