Add bash version of script. Add Support for OSX.

Port the Perl script to Bash to minimize dependencies.

I also am using sysctl for support for OSX and checking platform name with `uname -s`