cmd:realpath - return the canonicalized absolute pathname 

realpath expands all symbolic links and resolves references to '/./', '/../' and extra '/' characters in the null terminated string named by path and stores the canonicalized absolute pathname in the buffer of size PATH_MAX named by resolved_path. The resulting path will have no symbolic link, '/./' or '/../' components.

first appeared in BSD 4.4, appears in libc 4.5.21 in Linux.

The BSD 4.4, Linux and SUSv2 versions always return an absolute path name. Solaris may return a relative path name when the path argument is relative.