From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24423 invoked by alias); 22 Jan 2013 10:23:25 -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: 17600 Received: (qmail 17965 invoked from network); 22 Jan 2013 10:23:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at picard.franken.de does not designate permitted sender hosts) Date: Tue, 22 Jan 2013 11:14:40 +0100 From: Thomas =?iso-8859-1?Q?K=F6hler?= To: zsh-users@zsh.org Subject: Re: Resolving absolute path of named directory Message-ID: <20130122101440.GA8372@picard.franken.de> Mail-Followup-To: zsh-users@zsh.org References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline In-Reply-To: X-Operating-System: Linux X-Editor: VIM - Vi IMproved 7.2 http://www.vim.org/ X-IRC: tirc; Nick: tkoehler X-URL: http://gott-gehabt.de/800_wer_wir_sind/thomas/Homepage/index.html User-Agent: Mutt/1.5.4i --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, Jesper Nyg=E5rds wrote: >=20 > Say I have a string containing a directory name. I know I can use the :a > modifier to turn the string into the absolute path, but this does not seem > to work with named directories, and if I read the documentation correctly, > it's not supposed to. I wonder how I can go about resolving the string if > it is a named directory. >=20 > Here's an example of what I mean: > % pwd > /c/Program/Java > % ls > jdk16 jdk17 jre6 jre7 > % mydir=3D"jre6" > % print ${mydir:a} > /c/Program/Java/jre6 # Expexted > % pr=3D~/projects > % mydir=3D"~pr" > % print ${mydir:a} > /c/Program/Java/~pr # What I wanted was "/home/jesper/projects" >=20 > So, in the above example, is there a way to make $mydir resolve to the > absolute path of the named directory ~pr, without using an external progr= am? I expect what you want is not % pr=3D~/projects % mydir=3D"~pr" but % pr=3D~/projects % mydir=3D"$pr" instead. Or you might want % mydir=3D~/projects % print ${mydir:a} Ciao, Thomas --=20 Thomas K=F6hler Email: jean-luc@picard.franken.de <>< WWW: http://gott-gehabt.de IRC: tkoehler Freenode: thkoehler PGP public key available from Homepage! --M9NhX3UHpAaciwkO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQFQ/maQTEYXWMJlHuYRApq/AKCNxMIMdwlJasjMpd4a6lFRIeodrACgg3Xw atoI0oVBJbyBOoa23grytJQ= =/WPF -----END PGP SIGNATURE----- --M9NhX3UHpAaciwkO--