From 9001e459e7a9024297863105a017327f224faf09 Mon Sep 17 00:00:00 2001 From: epochqwert Date: Sun, 21 Jun 2015 23:22:09 -0500 Subject: elapsedtime doesn't show days if there aren't any now. --- nocompile/bin/elapsedtime | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'nocompile/bin/elapsedtime') 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 -- cgit v1.2.3