Compare Date with String in date format

Hi,
I am new to this forum, searched, but for some reason did not find much help, so a new thread.

I am trying to compare date with a string which is in date format [dd-mm-yyyy], but for some reason, system does not give me the right result.

Date is coming in a file and i am comparing the same with today date. If they match, we are good, if not, we have a problem.

date in the file store as fd and today date as td. Both are in dd-mm-yyyy formats.

if [ $fd <> $td ] then
echo "File received does not contains current data, Please check"
else
echo "File has been downloaded with today data"
fi

above loop always goes in first statement even if the the variable contains same date string.

Any help would be appreciated.

Use operator != instead:

if [ "$fd" != "$td" ]
then
      # action
else
      # action
fi

For further reference: String Comparison Operators

<> is a BASIC thing, haven't seen it much in other languages.