diff options
author | epochqwert <epoch@hacking.allowed.org> | 2015-06-21 23:22:09 -0500 |
---|---|---|
committer | epochqwert <epoch@hacking.allowed.org> | 2015-06-21 23:22:09 -0500 |
commit | 9001e459e7a9024297863105a017327f224faf09 (patch) | |
tree | 9cbb38f052bdce2fd0d2e24f68a73ac91c9577b2 /nocompile | |
parent | 21afacf4e3b5b03b15243a486a6e888a245c0052 (diff) | |
download | misc-9001e459e7a9024297863105a017327f224faf09.tar.gz misc-9001e459e7a9024297863105a017327f224faf09.zip |
elapsedtime doesn't show days if there aren't any now.
Diffstat (limited to 'nocompile')
-rwxr-xr-x | nocompile/bin/elapsedtime | 5 |
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 |