Gentoo Archives: gentoo-user

From: Tanstaafl <tanstaafl@×××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Filter grep output of 'ps aux'
Date: Sat, 03 Mar 2012 13:01:32
Message-Id: 4F5215DC.7040904@libertytrek.org
In Reply to: Re: [gentoo-user] Filter grep output of 'ps aux' by Paul Hartman
1 On 2012-03-02 4:52 PM, Paul Hartman <paul.hartman+gentoo@×××××.com> wrote:
2 > On Fri, Mar 2, 2012 at 3:23 PM, Tanstaafl<tanstaafl@×××××××××××.org> wrote:
3 >> Attempt at incorporating your command into this:
4 >> watch -n1 "ps aux --sort=-%cpu | gawk 'NR==1; $3> 0'"
5 >>
6 >> it gives me a syntax error:
7 >>
8 >> Every 1.0s: ps aux --sort=-%cpu | gawk 'NR==1;> 0'
9 >> Fri Mar 2
10 >> 16:19:01 2012
11 >>
12 >> gawk: NR==1;> 0
13 >> gawk: ^ syntax error
14 >>
15 >> Any ideas on how to get this working in the watch version
16
17 > Put a backslash before the $, it needs to be escaped in that context.
18
19 Aaargh! I could have sworn I tried that... but yes, now it works
20 perfectly...
21
22 Thanks Paul - Gentoo support is the best, even for general linux
23 questions like this...