[plug] Using the "cut" command on fields seperated with variable number of spaces

James Devenish devenish at cyllene.uwa.edu.au
Thu Jan 30 09:18:32 WST 2003


On Thu, Jan 30, 2003 at 08:59:27AM +0800, David Buddrige wrote:
> USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
> root         1  0.0  0.0  1368   76 ?        S     2002   0:04 init [5]

As an aside, if you have a specific task such as to find the PIDs of
particular (or all) processes, it can be better to use a tool designed
to do just that, rather than doing text processing on general programme
output. If there are more tailored tools (and there are), you may find
you have more better control over the task performed, the process is
more efficient, and the output is more predictable. Just a thought.




More information about the plug mailing list