/usr/ucb/ps
From: Bill (bill_at_nospcomcast.net)
Date: 06/28/03
- Next message: ml: "iDS 5.1, idsconfig - ERROR: update of schema attributes failed!"
- Previous message: Scott Shinault: "cron log ts=139 errors"
- Next in thread: Tony Fuller: "Re: /usr/ucb/ps"
- Reply: Tony Fuller: "Re: /usr/ucb/ps"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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
- Next message: ml: "iDS 5.1, idsconfig - ERROR: update of schema attributes failed!"
- Previous message: Scott Shinault: "cron log ts=139 errors"
- Next in thread: Tony Fuller: "Re: /usr/ucb/ps"
- Reply: Tony Fuller: "Re: /usr/ucb/ps"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|