#!/bin/bash find $1 -name "gdb.log" | \ while read line; do #echo $line start=$(head -n1 $line | sed 's/Test run by .* on //g') end=$(tail -n1 $line | sed 's/.*completed at //g') #echo start=$start #echo end=$end start_sec=$(date --date="$start" '+%s') end_sec=$(date --date="$end" '+%s') duration_sec=$((end_sec - start_sec)) echo "$duration_sec seconds for $line" done