On 2012-03-02 4:52 PM, Paul Hartman <paul.hartman+gen...@gmail.com> wrote:
On Fri, Mar 2, 2012 at 3:23 PM, Tanstaafl<tansta...@libertytrek.org>  wrote:
Attempt at incorporating your command into this:
watch -n1 "ps aux --sort=-%cpu | gawk 'NR==1; $3>  0'"

it gives me a syntax error:

Every 1.0s: ps aux --sort=-%cpu | gawk 'NR==1;>    0'
                                                            Fri Mar  2
16:19:01 2012

gawk: NR==1;>    0
gawk:        ^ syntax error

Any ideas on how to get this working in the watch version

Put a backslash before the $, it needs to be escaped in that context.

Aaargh! I could have sworn I tried that... but yes, now it works perfectly...

Thanks Paul - Gentoo support is the best, even for general linux questions like this...

Reply via email to