Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!convex!usenet From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.questions Subject: Re: how to grep multiply strings Keywords: grep regular expression Message-ID: <1991Feb01.180838.26811@convex.com> Date: 1 Feb 91 18:08:38 GMT References: <531@ctycal.UUCP> Sender: usenet@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 24 Nntp-Posting-Host: pixel.convex.com From the keyboard of pat@ctycal.UUCP (Patrick Woo): :I am trying to display line that doesn't contain string1 or string2 or ... :stringn. :What I did was : :grep -v string1 | grep -v string2 | .... | grep -v stringn : :Just wondering if there is an easier way other than doing all this piping. :Thanks in advance. egrep -v 'string1|string2|string3|...|stringN' file or put them in a file and use fgrep -vf badstrings file Bear in mind that most standard fgrep's are terribly slow. --tom -- "Hey, did you hear Stallman has replaced /vmunix with /vmunix.el? Now he can finally have the whole O/S built-in to his editor like he always wanted!" --me (Tom Christiansen )