bash -n doesn't seem to catch all syntax errors...
From:
Ken Failbus
Subject:
bash -n doesn't seem to catch all syntax errors...
Date:
Mon, 15 Oct 2007 18:27:43 -0400
Hi Guys,
When I specify on command-line "bash -n <myscript name>". Bash doesn't
check for valid syntax errors. E.g. if variable is missing a "$" infront
of it while assigning a value. This is not catched by bash. Is there a
more specific option that should be specified to bash to check for
syntax errors.
Regards,
Ken
### example code
p=hello
e=world
If [ p != $e ];then
echo "not equal"
else
echo "equals"
fi