/usr/ucb/ps

From: Bill (bill_at_nospcomcast.net)
Date: 06/28/03


Date: Fri, 27 Jun 2003 19:45:28 -0400

Hello all,

I need to be able to parse the output of the /usr/ucb/ps command which
unlike the /bin/ps command does not appear to provide formatting options via
the -o switch. I need to capture the user and command fields and I figure I
should use awk or nawk to achieve this. The problem I am encountering is
that the output of the command is variable in width especially the start and
time columns.

 The method I am using to try to capture the information is as follows:

 /usr/ucb/ps -auxww | awk {print " " $1 " " $12 }'

example output of /usr/ucb/ps:

 USER PID %CPU %MEM SZ RSS TT S START TIME COMMAND

root 18189 0.9 0.1 4128 4024 pts/7 O 16:04:38 0:02
/usr/ucb/ps -auxww

root 3 0.5 0.0 0 0 ? S Jun 08 1534:01 fsflush

arsrep 24503 0.3 0.67436070688 ? S Jun 08 849:28 arserverd

db2mqsi 12887 0.2 0.58720055904 ? S Jun 24 51:13 db2agent
(MQSIRULE)

mqm 12124 0.2 0.27314425000 ? S Jun 22 99:24
amqzlaa0 -mDBT03SP

-fip23

Any help would be much appreciated.

Thank you,
Bill



Relevant Pages

  • Re: Automated Deployment Services and VSMT
    ... I put the target and master server in the same switch. ... Ran the capture and it worked fine. ... > command to return the geometry of your hard-disk. ...
    (microsoft.public.windows.server.setup)
  • Re: Catching errors in a shell scripts
    ... and `command` (incidentially I find ... doesn't capture standard error. ... to make the output escape ... Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ...
    (Ubuntu)
  • Re: [SLE] The "cp" command is skipping files/dirs over nfs
    ... you can capture any output to a file. ... The best way I can think of for seeing it also, is to tail the capture file. ... To be able to see the stuff as it is written to the file, call the command (on ... On Wednesday 19 April 2006 10:59 am, James D. Parra wrote: ...
    (SuSE)
  • Re: Catching errors in a shell scripts
    ... and `command` (incidentially I find the ... capture standard error. ... $alloutput" mktemp generates a random filename, ... Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ...
    (Ubuntu)
  • Re: Command Line and Video Capture/Tuner Cards
    ... A tool to capture single/multiple images or record movies from a video4linux ... command one of those video capture/tuner cards to begin recording ...
    (Debian-User)