Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!ox.com!ox.com!emv From: emv@ox.com (Ed Vielmetti) Newsgroups: comp.unix.programmer Subject: Re: deamon help Message-ID: Date: 6 Feb 91 00:01:17 GMT References: <594@edpmgt.UUCP> <2304@inews.intel.com> Sender: usenet@ox.com (Usenet News Administrator) Organization: OTA Limited Partnership, Ann Arbor MI. Lines: 25 In-Reply-To: bhoughto@hopi.intel.com's message of 5 Feb 91 21:50:31 GMT In article <2304@inews.intel.com> bhoughto@hopi.intel.com (Blair P. Houghton) writes: For example (output of "ps alx | egrep 'TIME|foo'"): F UID PID PPID CP PRI NI ADDR SZ RSS WCHAN STAT TT TIME COMMAND 94080012010 11236 11235255 96 41eba211194 9660 R N pa143:58 (foo) b0000013092 17289 244 7 1 017232 41 21 be598 S 10 0:00 egrep TIME| PID 17829 is fine. PID 11236 is a mess. awk(1) and perl(1) would barf up gnodes at this. (Those of you who smell challenge, smell aright.) awk and sed (and perl for that matter) would do OK as long as they didn't assume that whitespace was a field delimiter; break on absolute columns with substr() or unpack(). that's not to say that ps doesn't have an interesting idea of how to jam fields together... If portability is not an issue I'd stick something into top (ps,sps etc) to print out the fields you want in a nice, tagged, easy to parse format. --Ed emv@ox.com ps. c vs. awk vs. perl isn't a wizards issue at all. hacking ps is.