I have a bash script that is comparing 2 dates ( one from a file that is stored in the server and the other using date
command), it was working just fine but after the month ended it cannot compare the 2 dates, here is the code:
consult)
local FECHA=`curl -s $URL_UPDATE | jq '.result[0].message.text' | awk -F "_" '{print $2}' | tr -d '"'`
local DATE=`date "+%d-%m-%y"`
if [[ ${FECHA#0} -ge ${DATE#0} ]]; then
$SEND"Wrong Date"
else
$SEND"Right Date"
fi
PD: The URL_UPDATE variable is just the Telegram API getUpdates url, I take the first date from the user via Telegram after the _ if the user puts any. About $SEND, is the "send_message" function from the Telegram API.