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:
> >     And my original question: can the array be assigned one line of
> > the file per slot without the loop?
> array=(${(f)"$(<filename)"})

    Yes :( I should have remembered this... A very intelligent, easy
an elegant solution. Thanks a lot for the help :))
 
> There are lots of examples like this in the completion code, except most
> are about fifty times more complicated.

    And its logical: I should have took a look at the completion
code, since it processes a lot of files. I just didn't thought of it,
sorry for the noise :((

    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'...).

    Again, thanks for your answer :)

    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