Use a little bit better bashisms

Tips from emg on #bash