more generic way to determine path, works in MacOS
Merge pull request #2718 from ajaxorg/bashpath

more generic way to determine path, works in MacOS