From: Wayne Davison <wayned@users.sourceforge.net>
To: Zsh <zsh-workers@sunsite.dk>
Subject: Re: Little doubt about an expansion flag
Date: Sat, 6 Sep 2003 13:36:47 -0700 [thread overview]
Message-ID: <20030906203647.GE24100@binome.blorf.net> (raw)
In-Reply-To: <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..
next prev parent reply other threads:[~2003-09-06 20:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-06 19:43 DervishD
2003-09-06 20:36 ` Wayne Davison [this message]
2003-09-06 21:20 ` DervishD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030906203647.GE24100@binome.blorf.net \
--to=wayned@users.sourceforge.net \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).