Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Little doubt about an expansion flag
- X-seq: zsh-workers 19035
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Zsh <zsh-workers@xxxxxxxxxx>
- Subject: Re: Little doubt about an expansion flag
- Date: Sat, 6 Sep 2003 13:36:47 -0700
- In-reply-to: <20030906194319.GA175@DervishD>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20030906194319.GA175@DervishD>
On Sat, Sep 06, 2003 at 09:43:19PM +0200, DervishD wrote:
> and I'm looking (deciphering is more appropriate) at the first
> part, namely ${(f)"$(ps xh)"}. When doing this, the output of the ps
> command is *joined*, deleting the \n characters!!!
Nope, the \n characters are not deleted because of the double quotes.
Try this:
echo "$(ps xh)"
You'll see that they are still there. This is different from this:
echo $(ps xh)
...where all the whitespace gets compressed and transformed into spaces.
> Finally, I would like to know how the shell manages to parse
> this: "${(f)"$(ps xh)"}", because it seems that the shell can read my
> mind and parses the quotes nested, and not like "${(f)" $(ps xh) "}".
Yes, this happens inside ${...} -- quotes start over in their nesting.
This is easy to do because it is useless to say "${(f)" (since that's a
syntax error), so the parser has no conflicts in its parsing choices --
it just assumes that the quote can't possibly be closing of the first
quote because the brace expression isn't done yet.
..wayne..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author