Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Absolute path of a path



On 2010-10-27 18:54:17 +0200, JÃrÃmie Roquet wrote:
> 2010/10/27 Vincent Lefevre <vincent@xxxxxxxxxx>:
> > BTW, is there a way to get the canonicalised absolute pathname
> > with zsh? (i.e. what the "realpath" command gives.)
> 
> your_path(:A) I guess :)

No. The zsh man path says:

  A    As  `a',  but also resolve use of symbolic links where possible.
       Note that resolution of `..' occurs before  resolution  of  symâ
       bolic  links.   This  call is equivalent to a unless your system
       has the realpath system call (modern systems do).

but Linux doesn't have a realpath system call.

ypig:~> man 2 realpath
No manual entry for realpath in section 2

FYI:

ypig:~> realpath symlink/../vlefevre/symlink
/home/vlefevre

ypig:~> echo symlink/../vlefevre/symlink(:A)
/home/vlefevre/vlefevre/symlink

where symlink is a symbolic link to ".".

-- 
Vincent LefÃvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / ArÃnaire project (LIP, ENS-Lyon)



Messages sorted by: Reverse Date, Date, Thread, Author