From: DervishD <raul@pleyades.net>
To: Zsh <zsh-workers@sunsite.dk>
Subject: Little doubt about an expansion flag
Date: Sat, 6 Sep 2003 21:43:19 +0200 [thread overview]
Message-ID: <20030906194319.GA175@DervishD> (raw)
Hi all :))
When looking at the recipe Oliver gave me for getting the pid of
a running process a few days ago, I discovered the (f) flag to
parameter expansion, which, according to the manual, means that the
expansion is split into lines (a shorthand for (ps:\n:).
Why is this splitting needed? I mean, the recipe is:
${${${(M)${(f)"$(ps xh)"}:#*$name*}## #}%% *}
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!!!
Obviously there is something I don't understand in the (f) flag
and in word splitting O:))) It can even be my bad english, who knows?
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) "}".
There are more of these ambiguities? How deals the shell with them?
Please excuse me for making so many questions about Zsh, but I
really want to know more of this shell. I'm amazed! Thanks a lot in
advance for being so kind with me when asking ;))
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/
next reply other threads:[~2003-09-06 19:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-06 19:43 DervishD [this message]
2003-09-06 20:36 ` Wayne Davison
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=20030906194319.GA175@DervishD \
--to=raul@pleyades.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).