Some more changes for MacOS
checks to be compatible with older bash versions
Also some fixes in profile
Emacs 24 removes the -c flag from emacsclient :(