#!/bin/bash
grep 'UTC\|EDT\|EST' file | cut -d' ' -f 8 | while IFS= read line; do
now=$(date | cut -d' ' -f 4)
time_now=$(date -u -d "$now" +"%s") #seconds
time_line=$(date -u -d "$line" +"%s") #seconds
difference=$(echo $((time_now - time_line)))
if [ $difference -lt 300 ]
then
echo "Time difference is less than 300 seconds"
else
echo "Time difference is more than 300 seconds"
fi
done