more generic way to determine path, works in MacOS

The addition of '-e' to readlink does not work in MacOS.
Please use this (more generic) determination of current script path.