diff options
author | Gary Sneed <gary@getcobalt.org> | 2024-10-25 20:23:21 -0700 |
---|---|---|
committer | Gary Sneed <gary@getcobalt.org> | 2024-10-25 20:23:21 -0700 |
commit | cf6e194a708d7a43d778a7cb8e31707225f1bb49 (patch) | |
tree | 055dbe0a15445541b0e08b8143d32e4a0ff9aec2 /get_playtime.sh |
Initial commitv1.0
Diffstat (limited to 'get_playtime.sh')
-rwxr-xr-x | get_playtime.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/get_playtime.sh b/get_playtime.sh new file mode 100755 index 0000000..9ca3e70 --- /dev/null +++ b/get_playtime.sh @@ -0,0 +1,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) |