in reply to Re: How to limit CPU utilization by ANY process with a perl script?
in thread How to limit CPU utilization by ANY process with a perl script?

Hmm, I think I might be misunderstanding what your one-liner is doing, but isn't the fourth element of @F %MEM, not %CPU?

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND marc 9764 0.0 1.9 85544 40380 ? S 15:47 0:07 pidgin
$ ps aux | perl -lane 'print if $F[3] == 1.9' marc 9764 0.0 1.9 85500 40376 ? S 15:47 0:07 pidgin

And you didn't even know bears could type.

Replies are listed 'Best First'.
Re^3: How to limit CPU utilization by ANY process with a perl script?
by bichonfrise74 (Vicar) on Feb 24, 2009 at 04:25 UTC
    That's true. In my case, the 4th element is for the CPU. I guess ps gives a different output depending on your Linux flavor.