Give checkbashisms a look. You can install it on Debian and its derivatives with
sudo apt-get install devscripts
Edit: It's a bit hard to find a current checkbashisms version on the Web (the one on SourceForge is an abandoned fork of an older version), so I've uploaded a recent stable one to http://pastebin.com/Ncu6DRuM. If you're not on Debian and decide to keep it clone git://anonscm.debian.org/collab-maint/devscripts.git.
I'm put off trying to really grok *sh scripting because the landscape seems a bit of a confusing mess.