Created
November 10, 2016 20:53
-
-
Save jrelo/467d8e00dbcf65aae672a17f145948cd to your computer and use it in GitHub Desktop.
add times with awk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
EPOCH='jan 1 1970' | |
sum=0 | |
for i in $(cat ${1}) | |
do | |
echo $i | |
sum="$(date -u -d "$EPOCH $i" +%s) + $sum" | |
echo $sum | |
done | |
echo -e "(${sum}) / 60 / 60"|bc -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment