#!/bin/sh if [ "_$1" != "_" ];then time=$1 else read time fi partials=$(echo $time | cut -d. -f2) wholes=$(echo $time | cut -d. -f1) seconds=$(( wholes % 60 )) minutes=$(( wholes/60 % 60 )) hours=$(( 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 if read time;then elapsedtime $time fi