Home > Backend Development > PHP Tutorial > linux awk time calculation script, linuxawk calculation script_PHP tutorial

linux awk time calculation script, linuxawk calculation script_PHP tutorial

WBOY
Release: 2016-07-12 09:05:07
Original
859 people have browsed it

linux awk time calculation script, linuxawk calculation script

If planning time is a troublesome thing in Linux,

The awk script is as follows

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>}
Copy after login

Email:362299908@qq.com

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1070665.htmlTechArticlelinux awk time calculation script, linuxawk calculation script in Linux If planning time is a troublesome thing, use the awk script as follows BEGIN { FS= " : " ;OFS= " : " } {total_seconds =total_seconds $ 3...
Related labels:
awk
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template