#! /bin/sh humantime() { s=$1 if [ -z $s ] then s=0 fi m=0 while [ $s -ge 60 ] do m=$(( $m + $s / 60 )) s=$(( $s % 60 )) done h=0 while [ $m -ge 60 ] do h=$(( $h + $m / 60 )) m=$(( $m % 60 )) done if [ $h -ne 0 ] then o=$o" $h hour" if [ $h -ne 1 ] then o=$o"s" fi fi if [ $m -ne 0 ] then o=$o" $m minute" if [ $m -ne 1 ] then o=$o"s" fi fi if [ $s -ne 0 ] then o=$o" $s second" if [ $s -ne 1 ] then o=$o"s" fi fi echo $o } humantime $*