I have a file with the following sample records for buy and sell events
Buy at time=Thu Aug 03 2023 14:13:08 GMT+0200 (Central European Summer Time) Sell-at time=Thu Aug 03 2023 14:53:02 GMT+0200 (Central European Summer Time)
I want to get whole UTC string from all the lines and get time difference between these records, however, i am not able to extract whole date time string to get differnce between them. i have tried this but not able to get time. Can any one help me out.
while read line do name=$line echo $name | sed -e 's/time=\(.*\)(Central/\1/' done < $1
Solution using shell, awk or sed is required. i can also use GNU date if required