Quantcast
Viewing latest article 8
Browse Latest Browse All 46

Answer by Alek for How to obtain the absolute path of a file via Shell (BASH/ZSH/SH)?

This is not an answer to the question, but for those who does scripting:

echo `cd "$1" 2>/dev/null&&pwd||(cd "$(dirname "$1")";pwd|sed "s|/*\$|/${1##*/}|")`

it handles / .. ./ etc correctly. I also seems to work on OSX


Viewing latest article 8
Browse Latest Browse All 46

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>