May 302010
How to perform syntax check on a bash script?
Answer:
You can perform syntax check on a bash script, without actually running it using the following command:
# bash -n script.sh
But if your script contain execution of other program, bash will not try to run it, even if it does not exist, error of this type will not be returned.