Update test.sh

This commit is contained in:
2019-02-07 22:39:19 -06:00
parent fb2f5b4f78
commit eacf5b3740

10
test.sh
View File

@@ -25,8 +25,14 @@ function show_time () {
if((num>59));then ((min=num%60)); ((num=num/60))
if((num>23));then ((hour=num%24)); ((day=num/24))
else ((hour=num)); fi; else ((min=num)); fi; else ((sec=num)); fi
echo "$day"d "$hour"h "$min"m "$sec"s
t=''
if [ $day != 0 ]; then t+="$day days "; fi
if [ $hour != 0 ]; then t+="$hour hours "; fi
if [ $min != 0 ]; then t+="$min mins "; fi
if [ $sec != 0 ]; then t+="$sec secs "; fi
echo $t
}
show_time ${1}