Originally Posted by Dralnu
First, I would change /bin/sh to /bin/bash. This way you should be sure that everything will work as expected incase this script it run on a diffrent system that has /bin/sh linked to another shell, or actually contains the old Bourne Shell.
I disagree. /bin/sh must be linked to bash-compatible shell, and in any system in the past decade it is definitely NOT the old Bourne shell.
I think it is correct to use /bin/sh instead of /bin/bash as TODAY it is more likely that bash may not be installed and instead /bin/sh is linked to say ksh or other bash-compatible. So it's better to use /bin/sh IMO.