From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9206 invoked from network); 6 Sep 2003 20:36:55 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 6 Sep 2003 20:36:55 -0000 Received: (qmail 23575 invoked by alias); 6 Sep 2003 20:36:49 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19035 Received: (qmail 23564 invoked from network); 6 Sep 2003 20:36:49 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 6 Sep 2003 20:36:49 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [192.54.253.222] by sunsite.dk (MessageWall 1.0.8) with SMTP; 6 Sep 2003 20:36:48 -0000 Received: by binome.blorf.net (Postfix, from userid 1000) id 05FF9308C; Sat, 6 Sep 2003 13:36:47 -0700 (PDT) Date: Sat, 6 Sep 2003 13:36:47 -0700 From: Wayne Davison To: Zsh Subject: Re: Little doubt about an expansion flag Message-ID: <20030906203647.GE24100@binome.blorf.net> References: <20030906194319.GA175@DervishD> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030906194319.GA175@DervishD> User-Agent: Mutt/1.5.4i 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..