SyntaxFix
Write A Post
Hire A Developer
Questions
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