fixed some bash pitfalls, got rid of depricated .sh

.sh file extension is considered harmful
http://www.talisman.org/~erlkonig/documents/commandname-extensions-considered-harmful

Quoting variables in bash is very important
"$variable" : http://mywiki.wooledge.org/Quotes