Add new comment
|
Hello, I would like to make one remark. When extracting the information out of the file top.txt, I would not rely on the fixed number for the column (35-39). If something happens like the number for ni(ce) or sy(stem) are taking more room than they do now, the information of your choice may end up in columns 38-43. I think it's better to take advantage of the patterns present in the file: after every column there is a "," : cat top.txt | grep ^Cpu | cut -d "," -f 4 | cut -d "%" -f 1 should do the job. Note futher that I use the ^ sign before Cpu. That's selecting only the lines which start with "Cpu". By omitting this, a line with Cpu somewhere in it is also selected. Kind regards, Stef Bon
Reply |




Recent comments
3 hours 51 min ago
5 hours 57 min ago
6 hours 7 min ago
8 hours 38 min ago
9 hours 27 min ago
12 hours 4 min ago
12 hours 28 min ago
14 hours 22 min ago
18 hours 33 min ago
21 hours 44 min ago