Know whether the shell script contains syntax error without running the script
bash -n scriptname
Although, this will check syntax, not command availability. (will not warn if script uses a command that is not installed yet)
I found an online tool to check the syntax of the script. In addition to checking the script, also suggests possible corrections to avoid errors.
Check shell script online