I am trying to run a shell script which checks whether today is the last Saturday of the current month and then it runs some script. For eg- 28th is the last Sat of this month. This is the code I am trying:
#!/bin/bash
DoDay=$(ncal -h | awk ' /Su/ {print $(NF-1)}')
Date=(date +%d)
if [[$Date == $DoDay]]
then
echo "Last Saturday"
else
echo "not last"
fi
While executing, it shows as :
ncal:command not found.
Can anybody please help here? Thanks in advance