What\'s an easy way to convert 00:20:40.28 (HH:MM:SS) to seconds with a Bash script?
00:20:40.28
Split seconds can be cut out, it’s not essential.
This would work even if you don't specify hours or minutes: echo "04:20:40" | sed -E 's/(.*):(.+):(.+)/\1*3600+\2*60+\3/;s/(.+):(.+)/\1*60+\2/' | bc
echo "04:20:40" | sed -E 's/(.*):(.+):(.+)/\1*3600+\2*60+\3/;s/(.+):(.+)/\1*60+\2/' | bc