From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,32c594a83e2d8db X-Google-Attributes: gidf7344,public X-Google-Thread: 114b0c,32c594a83e2d8db X-Google-Attributes: gid114b0c,public X-Google-Thread: 1164f8,32c594a83e2d8db X-Google-Attributes: gid1164f8,public X-Google-Thread: 111308,32c594a83e2d8db X-Google-Attributes: gid111308,public X-Google-ArrivalTime: 1993-09-24 21:37:54 PST Xref: gmd.de comp.client-server:1339 comp.os.vms:31271 comp.sys.dec:10344 comp.sys.hp:25080 Newsgroups: comp.client-server,comp.os.vms,comp.sys.dec,comp.sys.hp Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!decwrl!pa.dec.com!nntpd2.cxo.dec.com!nntpd.lkg.dec.com!ryn.mro4.dec.com!janix.pcs.dec.com!pcsrcu!tartufo!me From: me@tartufo.pcs.com (Michael Elbel) Subject: Re: Move from VMS to Open VMS or to HP-UX? Advice sought! Reply-To: me%dude.pcs.dec.com@inet-gw-2.pa.dec.com Organization: PCS Computer Systeme GmbH Date: Fri, 24 Sep 1993 14:16:53 GMT Message-ID: References: <1993Sep20.201114.18270@alpha.montagar.com> Sender: @pcsrcu.pcs.com In twilley@dewey.nl.nuwc.navy.mil (Jack Twilley) writes: >Ummm, maybe this instead: (will work for any user excepting the >current one...) >ps -ef | grep stupid | grep -v 'grep stupid' | wc -l Or what about reading the man-page to ps and do: ps -fu stupid | wc -l Works even under POSIX for VMS :-) Of course you could use: echo proc | crash | grep '^[^0-9]*[0-9][0-9]* s' | awk '{ print $6 }' | grep `grep ^stupid: /etc/passwd | sed 's/^[^:]*:[^:]*:\([^:]*\):.*$/\1/'` | wc -l and avoid ps altogether. This however only works if you *have* crash and the user-id is in column 6 of crash's proc output ;-) I think I'll have to write down what the regexp patterns meant, because I probably won't know what I did in two days :-) Also one could have used awk -F: '{ print $3 }' instead of the sed call to get stupid's UID, but, hey, you wouldn't want to leave sed out, would you? Michael Michael Elbel, Digital-PCS GmbH, Muenchen, Germany - me@dude.pcs.dec.com Intelligenz is sowieso nur wat fuer Doofe - Mia Fermentation fault (coors dumped)