Use FOO_VERSION variables to detect shells

Kludging around with ps is awkward and platform specific (Old
implemntation throws errors on osx)