ShellCheck is a static analysis tool for shell scripts.
Its goals are to point out and clarify typical beginner's syntax issues that causes a shell to give cryptic error messages, to point out and clarify typical intermediate level semantic problems that causes a shell to behave strangely and counter-intuitively, and to point out subtle caveats, corner cases, and pitfalls that may cause an advanced user's otherwise working script to fail under future circumstances.