I am trying to compare todays date with the last modified date from a file.
DATE=$(date +"%F")
LASTMOD=$(stat $i -c %y);
LASTMOD_DATE=$(cut -d' ' -f1 <<<"$LASTMOD")
if [ "$LASTMOD_DATE" -ge "$DATE" ]; then
printf "%-19s | " "$DATE"
else
printf "%-19s | " "NO RECENT MOD"
fi
Currently this does not compare them properly and I think it's because LASTMOD_DATE is not actually a datetime so I get the error: "integer expression expected".