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

Re: Can this be done with an array parameter?



    Hi Bart :)

 * Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> dixit:
> } Zsh is reading my mind or so. Can anybody explain?
> I note that PWS didn't bother to explain. :-)

    Well, he gave me the solution for the assignment without a loop ;)
 
> Unless the SH_WORD_SPLIT option is set, variable references like $info
> and $line aren't exactly quoted, but they aren't split up at spaces
> either.  $info is an array, so it acts (almost) like "${info[@]}", but
> $line is a scalar, so it acts (almost) like "$line".

    Oh, yes, I forgot about that. I simply assumed that, since array
values are space separated by default, the contents of the variables
were too. I didn't remember about word splitting O:)

    Thanks a lot for the explanation, Bart ;)

    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