运行时间定义:
starttime=`date +%s -d '2010-01-01 17:23:40'`
endtime=`date +%s -d '2010-01-01 15:01:47'`
time=`echo $(($endtime - $starttime)) | awk '{t=split("60 s 60 m 24 h 999 d",a);for(n=1;n<t;n+=2){if($1==0)break;s=$1%a[n]a[n+1]s;$1=int($1/a[n])}print s}'`
echo $time