Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: how to force scalar to be an array?
- X-seq: zsh-users 7941
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: ZSH User List <zsh-users@xxxxxxxxxx>
- Subject: Re: how to force scalar to be an array?
- Date: Fri, 27 Aug 2004 14:27:36 -0700 (PDT)
- In-reply-to: <20040827154905.GA26846@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040827154905.GA26846@xxxxxxxxx>
- Reply-to: zsh-users@xxxxxxxxxx
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