blob: 9ca3e7050d5de25e47696f63be8eddac505f8fbe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#!/usr/bin/env sh
IFS=$'\n'
TOTAL=0
for I in $(ls -1 playtime 2>/dev/null); do
TOTAL=$(echo $(cat "playtime/${I}") + "${TOTAL}" | nickle)
done
echo Total seconds: ${TOTAL}
echo Total minutes: $(echo ${TOTAL} / 60 | nickle)
echo Total hours: $(echo ${TOTAL} / 60 / 60 | nickle)
echo Total days: $(echo ${TOTAL} / 60 / 60 / 24 | nickle)
echo Total years: $(echo ${TOTAL} / 60 / 60 / 24 / 365.25 | nickle)
|