zsh-users
 help / color / mirror / code / Atom feed
* Resolving absolute path of named directory
@ 2013-01-22  8:50 Jesper Nygårds
  2013-01-22 10:14 ` Thomas Köhler
  0 siblings, 1 reply; 5+ messages in thread
From: Jesper Nygårds @ 2013-01-22  8:50 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 750 bytes --]

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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-01-23 23:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-22  8:50 Resolving absolute path of named directory Jesper Nygårds
2013-01-22 10:14 ` Thomas Köhler
2013-01-22 10:58   ` Jesper Nygårds
2013-01-22 19:45     ` Peter Stephenson
2013-01-23 19:19       ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).