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: 111308,32c594a83e2d8db X-Google-Attributes: gid111308,public X-Google-Thread: 1164f8,32c594a83e2d8db X-Google-Attributes: gid1164f8,public X-Google-Thread: 114b0c,32c594a83e2d8db X-Google-Attributes: gid114b0c,public X-Google-ArrivalTime: 1993-09-23 09:11:00 PST Xref: gmd.de comp.client-server:1324 comp.os.vms:31186 comp.sys.dec:10293 comp.sys.hp:24923 Path: gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!mcsun!ieunet!ieunet!vms.eurokom.ie!t_wade From: Tom Wade VMS Systems Newsgroups: comp.client-server,comp.os.vms,comp.sys.dec,comp.sys.hp Subject: Re: Move from VMS to Open VMS or to HP-UX? Advice sought! Message-ID: <1993Sep23.161016.12926@vms.eurokom.ie> Date: 23 Sep 93 16:10:15 CET References: Organization: EuroKom Conferencing Service In article , hansg@risken.vd.volvo.se (Hans Granqvist) writes: > peter@volvo.volvo.se (Peter Hkansson) writes: > >>ps -ef | grep stupid | wc -l (count nr of processes run by stupid) > > shouldn't this be more like: > > ps -ef | grep stupid | grep -v grep | wc -l > > (since your own `ps' will show up...)? ;-) > What happens if 'stupid' is also running grep ? Sorry, this is far too simple a command ..... how about % ps -ef | awk '{ print $1 }' | grep root | wc -l Yes, a command file would have been written in half the time it takes to debug one of these 'short cuts', but hey, the overriding goal is to get it ALL IN ONE LINE isn't it ? (Incidentally, be sure you use the lowercase "-ef" as the uppercase probably does something entirely different like initialize your file system). (Incidentally again, this works on System-V, on BSD the "-ef" may need to be changed to something slightly different but equally obvious like "-ax", so you have to test for which version to be complete). (Incidentally last, I confess that the incantation was supplied by our local Unix guru, as I wouldn't know awk from a bird call). ------------------------------------------------------------------------------ Tom Wade | Internet: T.Wade@vms.eurokom.ie (all domain mailers). Network Manager | DEC Enet: DECWRL::"t.wade@vms.eurokom.ie" (VMS Mail) EuroKom | PSI-Mail: PSI%272431001992::_T_WADE UCD Belfield | JANET: t.wade%ie.eurokom.vms@UK.AC.EARN-RELAY Dublin 4 | X400: g=tom;s=wade;o=eurokom;p=eurokom;a=eirmail400;c=ie Ireland | Telex: (0500) 91178 UCD EI ("TO: WADE" at start) -------------------+---------------------------------------------------------- Tel: +353-1-2830555| Official Disclaimer: "This is not a disclaimer" Fax: +353-1-2838605| Unix .... Just say No !