zsh-workers
 help / color / mirror / code / Atom feed
* Little doubt about an expansion flag
@ 2003-09-06 19:43 DervishD
  2003-09-06 20:36 ` Wayne Davison
  0 siblings, 1 reply; 3+ messages in thread
From: DervishD @ 2003-09-06 19:43 UTC (permalink / raw)
  To: Zsh

    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/


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-09-06 21:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-06 19:43 Little doubt about an expansion flag DervishD
2003-09-06 20:36 ` Wayne Davison
2003-09-06 21:20   ` DervishD

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).