首页 >后端开发 >php教程 >linux awk时间计算脚本,linuxawk计算脚本_PHP教程

linux awk时间计算脚本,linuxawk计算脚本_PHP教程

WBOY
WBOY原创
2016-07-12 09:05:07853浏览

linux awk时间计算脚本,linuxawk计算脚本

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

用awk脚本如下

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

Email:362299908@qq.com

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1070665.htmlTechArticlelinux awk时间计算脚本,linuxawk计算脚本 在linux如果计划时间是个麻烦事, 用awk脚本如下 BEGIN {FS= " : " ;OFS= " : " } {total_seconds =total_seconds+$ 3...
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn