diff options
Diffstat (limited to 'nocompile/bin/elapsedtime')
-rwxr-xr-x | nocompile/bin/elapsedtime | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/nocompile/bin/elapsedtime b/nocompile/bin/elapsedtime index 3d26597..ff7ea52 100755 --- a/nocompile/bin/elapsedtime +++ b/nocompile/bin/elapsedtime @@ -5,14 +5,21 @@ else read time fi -partials=$(echo $time | cut -d. -f2) +partials=$(echo $time | grep "\." | 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 +days=$(( 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 +echo -n $days days $hours:$minutes:$seconds +if [ "_$partials" != "_" ];then + echo .$partials +else + echo +fi if read time;then elapsedtime $time fi |