Given an absolute or relative path (in a Unix-like system), I would like to determine the full path of the target after resolving any intermediate symlinks. Bonus points for
To work around the Mac incompatibility, I came up with
echo `php -r "echo realpath('foo');"`
Not great but cross OS