How do I call the date +%a command in an if statement in bash? I’ve searched around google but can’t find anything. I’m trying to create a script so that if date +%a presents Mon I echo Backup your files!
So far I’ve tried this:
if [date +%a==Mon]
then
echo back
fi
Among other variations.
What am i missing?
I apologize in advance if this a dumb question, I’m new to Bash.
Use command substitution: