Not the first thing to look for, but I've found ShellCheck[1] to be pretty helpful when it comes to correcting typical mistakes.
It will highlight common mistakes, and their wiki explains each one detail and how you should use an alternate, better implementation.