add parse scripts
[utp-swift.git] / parse / parse_cpu_process
1 #!/bin/bash
2
3 awk '
4 BEGIN   {
5         count = 0
6         init = 1
7         printf "user\tsystem\tCPU\n"
8 }
9
10 /%CPU[ \t]+CPU[ \t]+Command/    {
11         count = 0
12         init = 0
13 }
14
15 {
16         count++
17         if (count == 2 && !init)
18                 printf "%s\t%s\t%s\n", $4, $5, $6
19 }
20 '