当前位置:首页 > 操作系统 > Linux

linuxawk时间计算脚本

在linux如果计划时间是个麻烦事,

用awk脚本如下

BEGIN {FS=":";OFS=":"}
 {total_seconds=total_seconds+$3}
 total_seconds>=60 {total_sec>60   $2=$2+1  }
{total_minutes=total_minutes+$2  $2=$2+1  }
{total_minutes=total_minutes+$2}
 total_minutes>=60{total_minutes=total_minutes-60 $1=$1+1}
{total_hours=total_hours+$1}
END{print $1,$2,$3}

Email:362299908@qq.com

以上就介绍了linux awk时间计算脚本,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!