From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8988 invoked from network); 12 May 2006 14:45:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 12 May 2006 14:45:36 -0000 Received: (qmail 6379 invoked from network); 12 May 2006 14:45:28 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 May 2006 14:45:28 -0000 Received: (qmail 12144 invoked by alias); 12 May 2006 14:45:21 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10255 Received: (qmail 12135 invoked from network); 12 May 2006 14:45:21 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 12 May 2006 14:45:21 -0000 Received: (qmail 5387 invoked from network); 12 May 2006 14:45:20 -0000 Received: from vms048pub.verizon.net (206.46.252.48) by a.mx.sunsite.dk with SMTP; 12 May 2006 14:45:19 -0000 Received: from torch.brasslantern.com ([71.116.105.50]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IZ5002AEQBFTVO1@vms048.mailsrvcs.net> for zsh-users@sunsite.dk; Fri, 12 May 2006 09:45:16 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k4CEjFVV015615 for ; Fri, 12 May 2006 07:45:15 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k4CEjFi0015614 for zsh-users@sunsite.dk; Fri, 12 May 2006 07:45:15 -0700 Date: Fri, 12 May 2006 07:45:15 -0700 From: Bart Schaefer Subject: Re: Parameter expansion flags question In-reply-to: To: Message-id: <060512074515.ZM15613@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: Comments: In reply to "John Cooper" "RE: Parameter expansion flags question" (May 12, 12:02pm) On May 12, 12:02pm, John Cooper wrote: } Subject: RE: Parameter expansion flags question } } > Placement of the quotes is important: } > for site in ${(f)"$($SITEMGR -i)":#} } } OK, changing the placement of the quotes to the above fixes it. There's } just one thing I'm a little puzzled about - in the case where $SITEMGR } produces no output, won't "$($SITEMGR -i)" be the empty string? If so, } why is :# needed? It seems it will just replace an empty string with } another empty string? It's the same as the difference between string="" array=( word "$string" word ) print $#array and string="" array=( word $string word ) print $#array An unquoted empty string is discarded; a quoted empty string is retained. Effectively the :# construct discards the quoted empty string, leaving an unquoted one in its place, which the shell in turn discards when building the final array.