SyntaxFix
Write A Post
Hire A Developer
Questions
readlink -e [filepath]
seems to be exactly what you're asking for - it accepts an arbirary path, resolves all symlinks, and returns the "real" path - and it's "standard *nix" that likely all systems already have