use osx compatible command to get absolute path of script