Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: RC_EXPAND_PARAM final patch
- X-seq: zsh-workers 3428
- From: <hzoli@xxxxxxxxxxxx> (Zoltan T. Hidvegi)
- To: borsenkow.msk@xxxxxx
- Subject: Re: RC_EXPAND_PARAM final patch
- Date: Wed, 6 Aug 1997 23:53:44 -0400 (EDT)
- Cc: hzoli@xxxxxxxxxxxx, zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <Pine.SV4.3.95.970806161128.13915G-100000@itsrm1> from Andrej Borsenkow at "Aug 6, 97 04:27:20 pm"
Andrej Borsenkow wrote:
> % a=(a "b ")
> % x=(x "y z")
[...]
> % setopt shwordsplit
> % args ${^a}1
> "a1" "b1" "1"
> % args ${^x}1
> "x1" "y1" "z1" ????
>
> Shouldn't it be "x1" "y" "z1" ?
Why? ${^x} in itself expands to 3 words, x y z, and that's combined with
`1'. With sh_word_split, a word with spaces acts like an array.
The first example is a bit more hard to understand. Here ${^a} expands to
3 words too, but the last word is a null word, which is removeded from the
argument list, unless it is contacenated with something real. That's why
${^a}1 expands to a1 b1 1, just immagine an invisible zero-length word
before the last 1.
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author