summaryrefslogtreecommitdiff
path: root/nocompile/bin/elapsedtime
diff options
context:
space:
mode:
authorepochqwert <epoch@hacking.allowed.org>2015-06-21 23:22:09 -0500
committerepochqwert <epoch@hacking.allowed.org>2015-06-21 23:22:09 -0500
commit9001e459e7a9024297863105a017327f224faf09 (patch)
tree9cbb38f052bdce2fd0d2e24f68a73ac91c9577b2 /nocompile/bin/elapsedtime
parent21afacf4e3b5b03b15243a486a6e888a245c0052 (diff)
downloadmisc-9001e459e7a9024297863105a017327f224faf09.tar.gz
misc-9001e459e7a9024297863105a017327f224faf09.zip
elapsedtime doesn't show days if there aren't any now.
Diffstat (limited to 'nocompile/bin/elapsedtime')
-rwxr-xr-xnocompile/bin/elapsedtime5
1 files changed, 4 insertions, 1 deletions
diff --git a/nocompile/bin/elapsedtime b/nocompile/bin/elapsedtime
index ff7ea52..f17d326 100755
--- a/nocompile/bin/elapsedtime
+++ b/nocompile/bin/elapsedtime
@@ -14,7 +14,10 @@ days=$(( wholes/60/60/24 ))
#days=$(( wholes/60/60/24 % 7 ))
#weeks=$(( wholes/60/60/24/7 ))
#echo $weeks weeks $days days $hours:$minutes:$seconds.$partials
-echo -n $days days $hours:$minutes:$seconds
+if [ "_$days" != "_0" ];then
+ printf '%d days ' "$days"
+fi
+printf "%02d:%02d:%02d" "$hours" "$minutes" "$seconds"
if [ "_$partials" != "_" ];then
echo .$partials
else