Replicate readlink -f as bash script using mainly dependencies available on most bash 3 platforms.
readlink -f