From 302fd34b8926ff485ee73c4d3a630687eb11ebe1 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 1 Jul 2022 12:20:41 +0200 Subject: [PATCH] time_duration.sh: some monir changes.. --- snippets/time_duration.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/snippets/time_duration.sh b/snippets/time_duration.sh index 1812c2e..a28d3c2 100755 --- a/snippets/time_duration.sh +++ b/snippets/time_duration.sh @@ -18,11 +18,23 @@ function time_duration () { local __t_s=`expr $__t_rest_h - $__t_m \\* 60` if [[ $__t_h -gt 0 ]]; then - echo "$__t_h h : $__t_m min : $__t_s sec" + if [[ $__t_h -lt 10 ]] ; then + echo " $__t_h h : $__t_m min : $__t_s sec" + else + echo "$__t_h h : $__t_m min : $__t_s sec" + fi elif [[ $__t_m -gt 0 ]]; then - echo "$__t_m min : $__t_s sec" + if [[ $__t_m -lt 10 ]] ; then + echo " $__t_m min : $__t_s sec" + else + echo "$__t_m min : $__t_s sec" + fi else - echo "$__t_s sec" + if [[ $__t_s -lt 10 ]] ; then + echo " $__t_s sec" + else + echo "$__t_s sec" + fi fi else