Hi,
I am getting the below error while comparing the month of a file to current month.
I am using ls -lrth
to get the month of that file and while using the if else condition i am getting the below error..
a1=`ls -lrth abc.txt | awk '{print substr($6,1,3)}'`
This gives me the month from the ls format
b1=`date | awk '{print substr($2,1,3)}'`
This gives me current month date
if [ "$a1" -eq "$b1" ]
then
echo "yes"
else
echo "no"
fi
i m getting "no" while testing and getting the below error.
[: Nov: integer expression expected
Can someone help me how to rectify this error.