From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22514 invoked from network); 15 May 2006 09:02:15 -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; 15 May 2006 09:02:15 -0000 Received: (qmail 38220 invoked from network); 15 May 2006 09:02:06 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 May 2006 09:02:06 -0000 Received: (qmail 768 invoked by alias); 15 May 2006 09:01:56 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10265 Received: (qmail 758 invoked from network); 15 May 2006 09:01:55 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 15 May 2006 09:01:55 -0000 Received: (qmail 37225 invoked from network); 15 May 2006 09:01:55 -0000 Received: from smtp.eu.citrix.com (195.153.38.115) by a.mx.sunsite.dk with SMTP; 15 May 2006 09:01:53 -0000 Received: from lonpexchmx01.citrite.net ([10.30.224.191]) by SMTP.EU.CITRIX.COM with ESMTP; 15 May 2006 10:01:38 +0100 X-IronPort-AV: i="4.05,128,1146438000"; d="scan'208"; a="5134555:sNHT39867108" Received: from lonpexch01.citrite.net ([10.30.224.136]) by lonpexchmx01.citrite.net with Microsoft SMTPSVC(6.0.3790.1830); Mon, 15 May 2006 10:01:37 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Parameter expansion flags question Date: Mon, 15 May 2006 10:01:36 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Parameter expansion flags question Thread-Index: AcZ10sGySQdhosY1Sle2cQcJzcPSMQCK12ug From: "John Cooper" To: "Bart Schaefer" , X-OriginalArrivalTime: 15 May 2006 09:01:37.0515 (UTC) FILETIME=[2C4B03B0:01C677FE] Ah, I see. Thanks again for all the help. --- John -----Original Message----- From: Bart Schaefer [mailto:schaefer@brasslantern.com]=20 Sent: 12 May 2006 15:45 To: zsh-users@sunsite.dk Subject: Re: Parameter expansion flags question 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)":#} }=20 } 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=3D"" array=3D( word "$string" word ) print $#array and string=3D"" array=3D( 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.