I'm writing a bash script to run on CentOS to first grab the the lines for the start and end of an application session, then output if the duration is longer than an hour.  The timestamp format in the logfile is:  2017-01-03T00:00:15.529596-03:00$i is the application session ID.Here is what I have so far:for i in $(  grep 'session-enter\|session-exit' logfile | awk '{ print $5}' ); do                        echo                         echo *****   $i   *****        grep 'session-enter\|session-exit' logfile | grep $i                start=$(grep session-enter logfile | grep $i | awk '{ print $1 }' | sed 's/-03:00//g')                end=$(grep session-exit logfile | grep $i | awk '{ print $1 }' | sed 's/-03:00//g')                epochStart=$(date -d $start +%s )                epochEnd=$(date -d $end +%s )                                duration=$( date -u -d 0 $epochEnd seconds - $epochStart seconds +%H:%M:%S )                        if [ $epochStart= ] || [ $epochEnd= ]                                then                                     echo Duration: $duration                                else                                     continue                        fidoneAny help on this is greatly appreciated.
bash: Is the duration between two timestamps more than one hour?
bash