From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24364 invoked by alias); 20 Jul 2016 12:44:10 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21781 Received: (qmail 8745 invoked from network); 20 Jul 2016 12:44:10 -0000 X-Qmail-Scanner-Diagnostics: from ioooi.vinc17.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(92.243.22.117):SA:0(-1.3/5.0):. Processed in 0.154452 secs); 20 Jul 2016 12:44:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: vincent@vinc17.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Wed, 20 Jul 2016 14:44:03 +0200 From: Vincent Lefevre To: Bart Schaefer Cc: zsh-users@zsh.org Subject: Re: realpath(3), symlinks, '..' components, and the ':A' word modifier Message-ID: <20160720124403.GA20092@zira.vinc17.org> Mail-Followup-To: Bart Schaefer , zsh-users@zsh.org References: <20160705045756.GC11492@tarsus.local2> <20160705125430.GA29959__3886.85245202414$1467723835$gmane$org@mobil.systemanalysen.net> <20160707020022.GA6364@tarsus.local2> <160707102031.ZM23611@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <160707102031.ZM23611@torch.brasslantern.com> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.6.2-6725-vl-r89564 (2016-07-16) On 2016-07-07 10:20:31 -0700, Bart Schaefer wrote: > On Jul 7, 2:00am, Daniel Shahaf wrote: > } To everyone who asked about compatibility: under the existing semantics > } of :A, "$foo" and "$foo:A" might denote different files. > > But that implies that "$foo" and "$foo:a" might also denote different > files, so why is *that* a useful transformation? IMHO, the only useful transformation is to the same file (the usual realpath). Note that some scripts may use ":A" thinking that one would get the same file. So, changing the behavior may also fix these scripts! > } So, bottom line... it seems the consensus on both lists is not to risk > } breaking compatibility here, and to add another :x modifier letter > } instead (as suggested by Roland here and by pws/Bart in workers/38798 et > } seq). > > There's no letter to use that won't in some way be confuse-able with a > parameter expansion flag, so here are some ideas: > > :L - mnemonic "link" - corresponds to "ls -L" > :R - mnemonic "real" - think of realpath() > :P - mnemonic "path" - the other half of realpath(), and also in a > certain way comparable to the (P) parameter > flag in that it interprets the path name as > a further path name and yields the file at > the other path If you do not want to change the behavior of ":A", then ":R" is probably the best one. ":L" would definitely be a bad choice as it could be confused with "realpath -L" from GNU coreutils, which does the opposite (the default being "realpath -P", so using ":P" could be OK too, where "P" means "physical"). In any case, the documentation should be clarified. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)