Switching from readlink

Turns out Mac OS X does not have a readlink that supports -f.  Since I
am worrying about finding the actual directory name only, I can use
bash's built in things to achieve the same goal.