Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ucla-cs!zen!ucbvax!jade!eris!chapman From: chapman@eris.BERKELEY.EDU (Brent Chapman) Newsgroups: comp.unix.questions Subject: Re: awk pattern matching Message-ID: <4645@jade.BERKELEY.EDU> Date: Sat, 8-Aug-87 13:23:09 EDT Article-I.D.: jade.4645 Posted: Sat Aug 8 13:23:09 1987 Date-Received: Sun, 9-Aug-87 20:42:51 EDT References: <1092@gilsys.UUCP> Sender: usenet@jade.BERKELEY.EDU Reply-To: chapman@eris.BERKELEY.EDU (Brent Chapman) Organization: UNIXversity of California at Berkeley Lines: 31 Keywords: awk, patterns, matches If your list is small, perhaps attacking the problem from the other direction would work. For instance, if you were looking for entries other than "root" and "me", any of the following scripts will work. You might want to determine empirically which is best (fastest, whatever). Script #1: $6 ~ /^root/ { next } $6 ~ /^me/ { next } { print $0 } ----- Script #2 $6 ~ /^root|^me/ { next } { print $0 } ----- Script #3 $6 !~ /^root|^me/ # No, there is no action here; default is to print # Yes, that's the whole script. ----- Hopefully helpfully, -Brent -- Brent Chapman Senior Programmer/Analyst chapman@mica.berkeley.edu Capital Market Technology, Inc. ucbvax!mica!chapman 1995 University Ave., Suite 390 Phone: 415/540-6400 Berkeley, CA 94704