From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2485 invoked by alias); 22 Jan 2013 08:50: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: 17599 Received: (qmail 10019 invoked from network); 22 Jan 2013 08:50: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=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.210.173 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=mZgyud8Imf5JvfCC1hT0XH7tCH2VrF2zq9sFbO43WDY=; b=HnZf7nx8+osL2atE8gOLZjAXvjtQaeyzfdqAAJneoiNNi1yow2LdKvqrg4de+ks4HY sxAgGEV1KS4guCB/Q68ovPaH8EXQ/qax3OUeFQqfgjrg2BHyQPuULHcxKWs2EhJaqSBz srxDdG+axTvqRHdJm3qdJ4rq06kKZvJOupogc2tmVl+dSEjFONA9AaqSzabP+sukA4EP QF5ip9XuOJ83rdzw/ewY9RpnL+3Lf1tL/pVGs9Sv/4AFQrK9H7kQWfO2uZUw5QEHno7e joJjKPNAIWoaoumG4U6sPsf/YxnsjAFWxLXJFYSnpXfpF/O7A6S+mxAC3STuKcIFC50J 1Afw== MIME-Version: 1.0 X-Received: by 10.50.16.144 with SMTP id g16mr11520035igd.2.1358844614690; Tue, 22 Jan 2013 00:50:14 -0800 (PST) Date: Tue, 22 Jan 2013 09:50:14 +0100 Message-ID: Subject: Resolving absolute path of named directory From: =?ISO-8859-1?Q?Jesper_Nyg=E5rds?= To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=f46d044305ce90471204d3dcaadc --f46d044305ce90471204d3dcaadc Content-Type: text/plain; charset=ISO-8859-1 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. Here's an example of what I mean: % pwd /c/Program/Java % ls jdk16 jdk17 jre6 jre7 % mydir="jre6" % print ${mydir:a} /c/Program/Java/jre6 # Expexted % pr=~/projects % mydir="~pr" % print ${mydir:a} /c/Program/Java/~pr # What I wanted was "/home/jesper/projects" 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 program? --f46d044305ce90471204d3dcaadc--