I am learning shell script and I find different syntax for shell script conditional statements. Does csh script have a different syntax than tcsh script. Some say
if [ "$PASSWORD" == "$VALID_PASSWORD" ]; then
echo "You have access!"
else
echo "ACCESS DENIED!"
fi
some use
if ($PASSWORD == $VALID_PASSWORD)
echo "You have access!"
else
echo "ACCESS DENIED!"
endif
I tried my own and I get errors like "if: Empty if" or "If: Expression Syntax" and these messages are very brief to understand. So I thought of asking how to sort out these issues and are there solutions different based on shell (csh, tcsh)
If my shell is tcsh, should I always tcsh script or can I write bash script.