views:

350

answers:

1

On a GNU system I would just use readlink -f $SOME_PATH, but Solaris doesn't have readlink.

I'd prefer something that works well in bash, but other programs are ok if needed.

Edit: The best I've come up with so far uses cd and pwd, but requires some more hackery to deal with files and not just directories.

cd -P "$*"
REAL_PATH=`pwd`
+1  A: 

Does this help?

"Canonical Path of File in Bash" on PublicObject.com

Sean Bright
Ah yes, that'll do it.
alberge