I'm trying to write a shell script with an OR statement and I believe the syntax is correct yet its not working properly - no matter what the value is it always response Yes! (even though the value is 09). Here's the script:
Code:
#!/bin/sh
DOM=`date +%d`
echo "Today's date of the month is the $DOM."
if [ $DOM="07" ] || [ $DOM="14" ] || [ $DOM="21" ] || [ $DOM="28" ]; then
echo "Yes!"
else
echo "No!"
fi
I've already tried using double equal signs (== instead of =), but I get the same results.
Any ideas?