From cf6e194a708d7a43d778a7cb8e31707225f1bb49 Mon Sep 17 00:00:00 2001 From: Gary Sneed Date: Fri, 25 Oct 2024 20:23:21 -0700 Subject: Initial commit --- get_playtime.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 get_playtime.sh (limited to 'get_playtime.sh') 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) -- cgit v1.2.3