namei
but it result returns in form$ namei /etc/gdc f: /etc/gdc d / d etc l gdc -> /home/hynek/.gdc d / d home d hynek l .gdc -> work/tiger/bear/common/etc/gdc d work d tiger l bear -> bear.trunk/ d bear.trunk d common d etc d gdcbut I suspected something more like
$ abs_path /etc/gdc /home/hynek/work/tiger/bear.trunk/common/etc/gdcI haven't found anything better than make alias in my
~/.bashrc
alias abs_path='perl -MCwd -le'\''print Cwd::abs_path($_) foreach @ARGV'\'
Edit: As ZD notice readlink -f
does same work. Thanks. readlink -m
and readlink -e
works as well but differs if some parts missing. I have decided to use
alias abs_path='readlink -m'
2 comments:
How about the simple readlink -f ?
@ZD: Yep, you've got it.
Post a Comment