Fixed a few bashisms, thanks to Trent W. Buck <trentbuck@gmail.com>.