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

Re: how to force scalar to be an array?



I'm sorry, I missed the second (result="foo") assignment when I was trying 
the examples, so I thought you always had a multi-word scalar to start 
with.  Ignore my previous message.

A scalar is a scalar, and the result of splitting a scalar is only an 
array if the split actually does something.

Further, using $=array forces the array to be a scalar and then applies
the preceding rule.

So your only safe bet is to actually assign the scalar to an array, and
then use subscripting on the array.



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