readlink isn't portable so give a try with pwd