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