From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22565 invoked from network); 18 Mar 2005 11:08:27 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Mar 2005 11:08:27 -0000 Received: (qmail 76785 invoked from network); 18 Mar 2005 11:08:21 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Mar 2005 11:08:21 -0000 Received: (qmail 5611 invoked by alias); 18 Mar 2005 11:08:10 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8609 Received: (qmail 5598 invoked from network); 18 Mar 2005 11:08:09 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Mar 2005 11:08:09 -0000 Received: (qmail 75327 invoked from network); 18 Mar 2005 11:08:09 -0000 Received: from mailhost1.csr.com (HELO MAILSWEEPER01.csr.com) (81.105.217.43) by a.mx.sunsite.dk with SMTP; 18 Mar 2005 11:08:05 -0000 Received: from exchange03.csr.com (unverified [10.100.137.60]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Fri, 18 Mar 2005 11:06:31 +0000 Received: from news01.csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 18 Mar 2005 11:09:57 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.1/8.12.11) with ESMTP id j2IB83IP008070 for ; Fri, 18 Mar 2005 11:08:03 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.13.1/8.13.1/Submit) with ESMTP id j2IB82Cq008067 for ; Fri, 18 Mar 2005 11:08:03 GMT Message-Id: <200503181108.j2IB82Cq008067@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: "Zsh Users' List" Subject: Re: Order of modifiers and flags in parameter expansion In-reply-to: <87ekeexiq3.fsf@lynx.bothi.fi> References: <87ekeexiq3.fsf@lynx.bothi.fi> Date: Fri, 18 Mar 2005 11:08:02 +0000 From: Peter Stephenson X-OriginalArrivalTime: 18 Mar 2005 11:09:57.0932 (UTC) FILETIME=[055D26C0:01C52BAB] X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.5 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.5 Hannu Koivisto wrote: > I have a script foo-files that prints filenames separated by > newlines. I want directory parts of those filenames and then I > want to get rid of duplicates. So I write > ${(u)${(f)"$(foo-files)"}:h} which works and the fact that it works > means that the h modifier is applied before the u flag. > Unfortunately I can't find where in the manual this order is > specified. I have read 13.3.2 but it didn't seem to consider the u > flag even indirectly. Any clues? It does happen in that order, but it's not currently documented. Index: Doc/Zsh/expn.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/expn.yo,v retrieving revision 1.51 diff -u -r1.51 expn.yo --- Doc/Zsh/expn.yo 22 Feb 2005 18:24:38 -0000 1.51 +++ Doc/Zsh/expn.yo 18 Mar 2005 11:05:29 -0000 @@ -973,16 +973,24 @@ occurrences of any of the characters in tt($IFS). Note this step, too, takes place at all levels of a nested substitution. ) -item(tt(10.) em(Re-Evaluation))( +item(tt(10.) em(Uniqueness))( +If the result is an array and the `tt((u))' flag was present, duplicate +elements are removed from the array. +) +item(tt(11.) em(Ordering))( +If the result is still an array and one of the `tt((o))' or `tt((O))' flags +was present, the array is reordered. +) +item(tt(12.) em(Re-Evaluation))( Any `tt((e))' flag is applied to the value, forcing it to be re-examined for new parameter substitutions, but also for command and arithmetic substitutions. ) -item(tt(11.) em(Padding))( +item(tt(13.) em(Padding))( Any padding of the value by the `tt(LPAR()l.)var(fill)tt(.RPAR())' or `tt(LPAR()r.)var(fill)tt(.RPAR())' flags is applied. ) -item(tt(12.) em(Semantic Joining))( +item(tt(14.) em(Semantic Joining))( In contexts where expansion semantics requires a single word to result, all words are rejoined with the first character of tt(IFS) between. So in `tt(${LPAR()P)tt(RPAR()${LPAR()f)tt(RPAR()lines}})' -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. **********************************************************************