Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!dciem!nrcaer!cognos!brianc From: brianc@cognos.uucp (Brian Campbell) Newsgroups: comp.unix.questions Subject: Re: awk pattern matching Message-ID: <1248@cognos.UUCP> Date: Thu, 13-Aug-87 14:45:55 EDT Article-I.D.: cognos.1248 Posted: Thu Aug 13 14:45:55 1987 Date-Received: Sun, 16-Aug-87 08:50:54 EDT References: <1092@gilsys.UUCP> Reply-To: brianc@cognos.UUCP (Brian Campbell) Organization: Cognos Incorporated, Ottawa, Canada Lines: 21 In article <1092@gilsys.UUCP> mc68020@gilsys.UUCP (Thomas J Keller) writes: ! ! Let's say I want to output any line from the sulog that indicates that a ! user other than root, news or me attempted to su. The format of the sulog ! records is: ! ! SU 08/05 09:30 + tty02 msi-root ! ! the 6th field (msi-root) is the field I want to match to. The basic ! pattern to be matched would be any of [root, news, me] with an explicit "-" ! and then *ANY* string of chars after that. I have tried: ! ! [ awk script expunged ] Unless there is more to your awk script than simply writing out the offending lines, what's wrong with: `egrep -v "root|news|mel" /usr/adm/sulog` -- Brian Campbell uucp: decvax!utzoo!dciem!nrcaer!cognos!brianc Cognos Incorporated mail: 3755 Riverside Drive, Ottawa, Ontario, K1G 3N3 (613) 738-1440 fido: sysop@163/8