From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32 invoked from network); 15 Mar 2009 01:08:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 15 Mar 2009 01:08:21 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 49856 invoked from network); 15 Mar 2009 01:06:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Mar 2009 01:06:12 -0000 Received: (qmail 28772 invoked by alias); 15 Mar 2009 01:06:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26736 Received: (qmail 28725 invoked from network); 15 Mar 2009 01:06:00 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 15 Mar 2009 01:06:00 -0000 Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bifrost.dotsrc.org (Postfix) with ESMTP id A9C2780307F8 for ; Sun, 15 Mar 2009 02:05:48 +0100 (CET) Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090315010545.DYCZ7670.mtaout03-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Sun, 15 Mar 2009 01:05:45 +0000 Received: from pws-pc ([81.107.42.185]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090315010545.NCQB13254.aamtaout01-winn.ispmail.ntl.com@pws-pc>; Sun, 15 Mar 2009 01:05:45 +0000 Date: Sun, 15 Mar 2009 01:05:43 +0000 From: Peter Stephenson To: Michael Hwang Cc: zsh-workers@sunsite.dk Subject: Re: PATCH: Modifiers that implement realpath-like feature Message-ID: <20090315010543.253a25e0@pws-pc> In-Reply-To: <664029.1117.qm@web37301.mail.mud.yahoo.com> References: <18038.70384.qm@web37308.mail.mud.yahoo.com> <20090314181458.007906bc@pws-pc> <664029.1117.qm@web37301.mail.mud.yahoo.com> X-Mailer: Claws Mail 3.7.0 (GTK+ 2.14.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=xFmxJyiJDpMA:10 a=Nq-cvyWCofIA:10 a=CjxXgO3LAAAA:8 a=NLZqzBF-AAAA:8 a=CgVUteYhiCPNzOVHe08A:9 a=s_FdZqicWhaEetdQKjEA:7 a=5V1_OgNGm0xLypNEwd9AGTOshxAA:4 a=LY0hPdMaydYA:10 a=rC2wZJ5BpNYA:10 a=_dQi-Dcv4p4A:10 X-Virus-Scanned: ClamAV 0.92.1/9109/Sat Mar 14 23:35:08 2009 on bifrost X-Virus-Status: Clean On Sat, 14 Mar 2009 14:27:09 -0700 (PDT) Michael Hwang wrote: > Sorry, here. Thanks, that seems to work well. I'll commit it with the following documentation. (Larger than necessary since I've taken the opportunity to reorder modifiers to alphabetical order since no other is particular obvious---with the exception that `&' follows `s' since ASCII order for that isn't particularly obvious either.) Index: Doc/Zsh/expn.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/expn.yo,v retrieving revision 1.102 diff -u -r1.102 expn.yo --- Doc/Zsh/expn.yo 6 Feb 2009 09:59:38 -0000 1.102 +++ Doc/Zsh/expn.yo 15 Mar 2009 01:03:57 -0000 @@ -216,20 +216,24 @@ noted. startitem() -item(tt(h))( -Remove a trailing pathname component, leaving the head. This works -like `tt(dirname)'. +item(tt(a))( +Turn a file name into an absolute path: prepends the current directory, +if necessary, and resolves any use of `tt(..)' and `tt(.)' in the path. ) -item(tt(r))( -Remove a filename extension of the form `tt(.)var(xxx)', leaving -the root name. +item(tt(A))( +As `tt(a)', but also resolve use of symbolic links where possible. +Note that resolution of `tt(..)' occurs em(before) resolution of symbolic +links. ) item(tt(e))( Remove all but the extension. ) -item(tt(t))( -Remove all leading pathname components, leaving the tail. This works -like `tt(basename)'. +item(tt(h))( +Remove a trailing pathname component, leaving the head. This works +like `tt(dirname)'. +) +item(tt(l))( +Convert the words to all lowercase. ) item(tt(p))( Print the new command but do not execute it. Only works with history @@ -244,15 +248,9 @@ item(tt(Q))( Remove one level of quotes from the substituted words. ) -item(tt(x))( -Like tt(q), but break into words at whitespace. Does not work with -parameter expansion. -) -item(tt(l))( -Convert the words to all lowercase. -) -item(tt(u))( -Convert the words to all uppercase. +item(tt(r))( +Remove a filename extension of the form `tt(.)var(xxx)', leaving +the root name. ) item(tt(s/)var(l)tt(/)var(r)[tt(/)])( Substitute var(r) for var(l) as described below. @@ -272,6 +270,17 @@ inside braces, and in filename generation it must be quoted with a backslash. ) +item(tt(t))( +Remove all leading pathname components, leaving the tail. This works +like `tt(basename)'. +) +item(tt(u))( +Convert the words to all uppercase. +) +item(tt(x))( +Like tt(q), but break into words at whitespace. Does not work with +parameter expansion. +) enditem() The tt(s/l/r/) substitution works as follows. By default the left-hand -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/