<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: a better way to exclude items other than a series of &amp;quot;grep -v&amp;quot; piped commands in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978807#M95627</link>
    <description>&amp;gt;handling it all in a single grep from the command line ...&lt;BR /&gt;&lt;BR /&gt;Your only problem was you only need one -v and the -e must be right before each pattern.&lt;BR /&gt;And if you didn't want to quote those ".", use fgrep.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Patrick: # find . -type f | grep -v -E "\.xml|\.gif|\.htm|\.html"&lt;BR /&gt;&lt;BR /&gt;There is no reason to use the egrep hammer.&lt;BR /&gt;Just use -f for that file solution.  Or use multiple -e:&lt;BR /&gt;grep -v -e "\.xml$" -e "\.gif$" ...</description>
    <pubDate>Wed, 11 Apr 2007 22:55:43 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2007-04-11T22:55:43Z</dc:date>
    <item>
      <title>a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978795#M95615</link>
      <description>This may be an awk question, a perl question, or a grep or sed problem...&lt;BR /&gt;&lt;BR /&gt;I've got a list of file name extensions I don't want to see, and I want everything else from a "find" list.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;find . -type f | grep -v "\.xml" | grep -v "\.gif" | grep -v "\.htm" | grep -v "\.html" &lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;and the list goes on for about 50 file extensions.&lt;BR /&gt;&lt;BR /&gt;Can anyone please demonstrate a better way to exclude a list from a find than spawning a bazillion greps?&lt;BR /&gt;&lt;BR /&gt;Note: handling it all in a single grep from the command line in the following fashion with something like "grep -e -v "\.gif" -e -v "\.htm" doesn't work.&lt;BR /&gt;&lt;BR /&gt;Note2: I'd be find with putting all of the extensions in an input file of some sort, so that part doesn't have to come from the command line itself.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance</description>
      <pubDate>Tue, 10 Apr 2007 18:36:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978795#M95615</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-04-10T18:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978796#M95616</link>
      <description>A couple of things come to mind:&lt;BR /&gt;&lt;BR /&gt;1) Do it all with find:&lt;BR /&gt;# find . -type f \( ! -name "*.xml" -o ! -name "*.gif" -o ! -name "*.htm" -o ! -name "*.html" \)&lt;BR /&gt;&lt;BR /&gt;Just keep listing your extensions.  The '-o' means a 'logical or' and the '! -name "*.htm"' means NOT anything ending with .htm.  Do a 'man find' for more info.&lt;BR /&gt;&lt;BR /&gt;2) You could do it with find and grep:&lt;BR /&gt;# find . -type f | grep -v -E "\.xml|\.gif|\.htm|\.html"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Apr 2007 18:50:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978796#M95616</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2007-04-10T18:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978797#M95617</link>
      <description>Hi John:&lt;BR /&gt;&lt;BR /&gt;Put the patterns you don't want returned in your selection in a file; something like:&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/excludes&lt;BR /&gt;.awk&lt;BR /&gt;.c&lt;BR /&gt;.htm&lt;BR /&gt;.html&lt;BR /&gt;.log&lt;BR /&gt;.old&lt;BR /&gt;.pl&lt;BR /&gt;.pm&lt;BR /&gt;.sh&lt;BR /&gt;&lt;BR /&gt;Now do:&lt;BR /&gt;&lt;BR /&gt;# find /tmp -type f |grep -E -v -f /tmp/excludes&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 10 Apr 2007 19:20:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978797#M95617</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-04-10T19:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978798#M95618</link>
      <description>Hi (again) John:&lt;BR /&gt;&lt;BR /&gt;Oops!  In your exclusive file, if you truly want to skip files with dot (".") suffixes, escape the dot in the exclusion specification.  The file contains regular expressions and a dot signifies any character when not escaped.  My example '/tmp/excludes' should have looked like:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/excludes&lt;BR /&gt;\.awk&lt;BR /&gt;\.c&lt;BR /&gt;\.htm&lt;BR /&gt;\.html&lt;BR /&gt;\.log&lt;BR /&gt;\.old&lt;BR /&gt;\.pl&lt;BR /&gt;\.pm&lt;BR /&gt;\.sh&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Apr 2007 19:29:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978798#M95618</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-04-10T19:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978799#M95619</link>
      <description>Patrick and James,&lt;BR /&gt;&lt;BR /&gt;Thanks for the suggestions, I really like the ability to use the file with "grep -v -E -f" command -that exactly what I'm looking for.&lt;BR /&gt;&lt;BR /&gt;Patrick - you're suggestion number #2 is quite cool, and I had BEEN wondering how to do an "or" in a grep for a word list *and* use it in an exclude grep function.  I had only used it (and then rarely) before for include functions, and somehow never put 2+2 together to make it work for an exclude function.  Thank you.&lt;BR /&gt;&lt;BR /&gt;Upon reflection, the list method is going to win the day, because I want to account for all file extensions in the intended directory, and it will go into the hundreds of named extensions.&lt;BR /&gt;&lt;BR /&gt;Thanks very much for the suggestions guys,&lt;BR /&gt;&lt;BR /&gt;John</description>
      <pubDate>Wed, 11 Apr 2007 10:16:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978799#M95619</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-04-11T10:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978800#M95620</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;And to get that list of file name extensions going you might want to use:&lt;BR /&gt;&lt;BR /&gt;perl -le 'while (&amp;lt;*&amp;gt;) { m/\.(.*)/; $seen{$1}++} print "\\.$_" foreach (sort keys %seen)'&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Apr 2007 10:40:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978800#M95620</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-04-11T10:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978801#M95621</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;# find . -type f | grep -v "\.xml" | grep -v "\.gif" | grep -v "\.htm" | grep -v "\.html"&lt;BR /&gt;&lt;BR /&gt;it's very ugly ;)&lt;BR /&gt;&lt;BR /&gt;prefer a shortcut:&lt;BR /&gt;# touch foo.xml foo.txt foo.htm foo.html foo.avi foo.dat&lt;BR /&gt;&lt;BR /&gt;# find . -type f |egrep -v "\.xml|\.gif|\.htm?"  &lt;BR /&gt;./foo.txt&lt;BR /&gt;./foo.avi&lt;BR /&gt;./foo.dat&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;and better is:&lt;BR /&gt;# G_ARGS=".\xml|.gif|\.htm?"&lt;BR /&gt;# find . -type f |egrep -v "$G_ARGS"           &lt;BR /&gt;./foo.txt&lt;BR /&gt;./foo.avi&lt;BR /&gt;./foo.dat&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Cedrick Gaillard</description>
      <pubDate>Wed, 11 Apr 2007 11:12:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978801#M95621</guid>
      <dc:creator>mobidyc</dc:creator>
      <dc:date>2007-04-11T11:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978802#M95622</link>
      <description>Hmm..&lt;BR /&gt;# cat /tmp/excludes&lt;BR /&gt;\.awk&lt;BR /&gt;\.c&lt;BR /&gt;\.htm&lt;BR /&gt;\.html&lt;BR /&gt;\.log&lt;BR /&gt;\.old&lt;BR /&gt;\.pl&lt;BR /&gt;\.pm&lt;BR /&gt;\.sh&lt;BR /&gt;&lt;BR /&gt;You may want to "anchor" the end of line as well, esp if you want to exclude .htm but *not* .html's&lt;BR /&gt;&lt;BR /&gt;something like:&lt;BR /&gt;&lt;BR /&gt;\.htm$&lt;BR /&gt;\.log$</description>
      <pubDate>Wed, 11 Apr 2007 11:24:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978802#M95622</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2007-04-11T11:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978803#M95623</link>
      <description>Hi (again) John:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; OldSchool: You may want to "anchor" the end of line as well, esp if you want to exclude .htm but *not* .html's&lt;BR /&gt;&lt;BR /&gt;Yes, absolutely true!  I'm afraid that I was in too much of a hurry to catch a favorite television show and assumed the appropriate nuances applied. ;-)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 11 Apr 2007 11:35:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978803#M95623</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-04-11T11:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978804#M95624</link>
      <description>OldSchool - thanks for catching the fine point of end of line - much appreciated.&lt;BR /&gt;&lt;BR /&gt;Hein -&amp;gt; I finished a script to do this as the initial part of the problem, but I'm intrigued by your perl script - because I've been slowly learning perl.  I'm betting I will be spending quite a bit of time trying to figure out how it works, thank you.  I really hate to ask - BUT... would you mind posting a little synopsis on the parts of that script and how it works, so I could learn?  If you don't have the time, or its too lengthy of a request, I certainly understand, so feel free to ignore the request.  Thanks again all.</description>
      <pubDate>Wed, 11 Apr 2007 12:40:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978804#M95624</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-04-11T12:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978805#M95625</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;It's actuallly no problem as I had it already written up two weeks ago.&lt;BR /&gt;And it is not perfect....&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://dcl.openvms.org/stories.php?story=07/03/22/8049141" target="_blank"&gt;http://dcl.openvms.org/stories.php?story=07/03/22/8049141&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There are more differences with the VMS version that I did not take care of.&lt;BR /&gt;- VMS needs to special case ";" as file version seperator&lt;BR /&gt;- and VMS typically is case-blind for filenames (Unless ODS-5 is used)&lt;BR /&gt;- VMS is strict about extentions allowing just 1 dot in the file name (unless ODS-5).&lt;BR /&gt;&lt;BR /&gt;=&amp;gt; The ; provided a 'right side' anchor for the regexp. Need to use $ for "eol" under Unix.&lt;BR /&gt;=&amp;gt; Need to allow for multiple dots.&lt;BR /&gt;&lt;BR /&gt;This gives:&lt;BR /&gt;&lt;BR /&gt;$ perl -le 'while (&amp;lt;*&amp;gt;) {$seen{$1}++ if /\.([^.]*$)/} print "\\.$_" foreach (sort keys %seen)'&lt;BR /&gt;&lt;BR /&gt;Explanation: &lt;BR /&gt;&lt;BR /&gt;-l = print new line with each print &lt;BR /&gt;&lt;BR /&gt;-e = program text to follow &lt;BR /&gt;&lt;BR /&gt;while (&amp;lt;*&amp;gt;) { = loop over 'globbed' list of files, putting filename in automatic variable $_ &lt;BR /&gt;&lt;BR /&gt;$seen{uc($1)}++ = Increment (and create) an associative array elemement with name being last match from $1 &lt;BR /&gt;&lt;BR /&gt;if /\.([^.]*$)/ = Only do the aforementioned on a match of a piece of string to be called $1 with 'any non dot' after a period and before end of line. The first period is escaped with a backslash to make it real, not a wild character &lt;BR /&gt;&lt;BR /&gt;} = loop end &lt;BR /&gt;&lt;BR /&gt;print = print the default variable $_ &lt;BR /&gt;&lt;BR /&gt;foreach (sort = loop over sorted array from... &lt;BR /&gt;&lt;BR /&gt;keys %seen = all the keys for associative array 'seen', stashed in default variable $_ one at a time.&lt;BR /&gt;&lt;BR /&gt;Regards, Hein van den Heuvel &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Apr 2007 13:38:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978805#M95625</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-04-11T13:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978806#M95626</link>
      <description>Hein, thank you very much for the posting, now I've got something to go to the books with and review.  That was graciously posted, thank you.&lt;BR /&gt;&lt;BR /&gt;I was laughing to myself looking over the code aspects as you've written them; because had I written them in Perl, they would have come out being a) MUCH longer, and b) looking like someone who is used to writing in both C and ksh "wrote a combination C/ksh script in perl".&lt;BR /&gt;:-)</description>
      <pubDate>Wed, 11 Apr 2007 14:13:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978806#M95626</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-04-11T14:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978807#M95627</link>
      <description>&amp;gt;handling it all in a single grep from the command line ...&lt;BR /&gt;&lt;BR /&gt;Your only problem was you only need one -v and the -e must be right before each pattern.&lt;BR /&gt;And if you didn't want to quote those ".", use fgrep.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Patrick: # find . -type f | grep -v -E "\.xml|\.gif|\.htm|\.html"&lt;BR /&gt;&lt;BR /&gt;There is no reason to use the egrep hammer.&lt;BR /&gt;Just use -f for that file solution.  Or use multiple -e:&lt;BR /&gt;grep -v -e "\.xml$" -e "\.gif$" ...</description>
      <pubDate>Wed, 11 Apr 2007 22:55:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978807#M95627</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-11T22:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978808#M95628</link>
      <description>Denis, &lt;BR /&gt;&lt;BR /&gt;thanks for your response - however a bit of clarification here is needed.  I said that the "grep -v -e" doesn't work, and it doesn't , at least in HPUX 11i (might work in the newer ones).&lt;BR /&gt;&lt;BR /&gt;So, while the "grep -v -e" in repetition works fine in Linux, it does not on HPUX:&lt;BR /&gt;&lt;BR /&gt;example:&lt;BR /&gt;&lt;BR /&gt;$ cat &amp;gt; test&lt;BR /&gt;ehlllo&lt;BR /&gt;goodbye&lt;BR /&gt;bye&lt;BR /&gt;hello&lt;BR /&gt;no &lt;BR /&gt;yes&lt;BR /&gt;sayit&lt;BR /&gt;say&lt;BR /&gt;yell&lt;BR /&gt;scream&lt;BR /&gt;ice cream&lt;BR /&gt;ice &lt;BR /&gt;cream&lt;BR /&gt;&lt;BR /&gt;$ cat test | grep -v -e "test" -v -e "yell" -v -e "ice"&lt;BR /&gt;ehlllo&lt;BR /&gt;goodbye&lt;BR /&gt;bye&lt;BR /&gt;hello&lt;BR /&gt;no &lt;BR /&gt;yes&lt;BR /&gt;sayit&lt;BR /&gt;say&lt;BR /&gt;yell&lt;BR /&gt;scream&lt;BR /&gt;ice cream&lt;BR /&gt;ice &lt;BR /&gt;cream&lt;BR /&gt;&lt;BR /&gt;Notice that no lines are missing:&lt;BR /&gt;&lt;BR /&gt;HOWEVER, on Linux the above test works as expected:&lt;BR /&gt;&lt;BR /&gt;$ cat test | grep -v -e "test" -v -e "yell" -v -e "ice" &lt;BR /&gt;ehlllo&lt;BR /&gt;goodbye&lt;BR /&gt;bye&lt;BR /&gt;hello&lt;BR /&gt;no&lt;BR /&gt;yes&lt;BR /&gt;sayit&lt;BR /&gt;say&lt;BR /&gt;scream&lt;BR /&gt;cream&lt;BR /&gt;&lt;BR /&gt;Which is why I put the question in the HPUX forum...</description>
      <pubDate>Thu, 12 Apr 2007 12:45:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978808#M95628</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-04-12T12:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978809#M95629</link>
      <description>Hi John:&lt;BR /&gt;&lt;BR /&gt;The '-v' switch needs to occur *once*:&lt;BR /&gt;&lt;BR /&gt;# grep -v -e "test" -e "yell" -e "ice" file&lt;BR /&gt;&lt;BR /&gt;By the way, you can skip the extra process (the 'cat') and let 'grep' open the file(s) specified as its argument(s) as above.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 12 Apr 2007 13:07:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978809#M95629</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-04-12T13:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978810#M95630</link>
      <description>"Note: handling it all in a single grep from the command line in the following fashion with something like "grep -e -v "\.gif" -e -v "\.htm" doesn't work."&lt;BR /&gt;&lt;BR /&gt;Actually, as noted above, it should be:&lt;BR /&gt;&lt;BR /&gt;grep -v -e "\.gif" -e "\.html" .....&lt;BR /&gt;&lt;BR /&gt;w/o repeating "-v".&lt;BR /&gt;&lt;BR /&gt;Unfortunately, Linux isn't unix, its a work-alike, developed from observed behaviour / documentation of unix + "enhancements"</description>
      <pubDate>Thu, 12 Apr 2007 13:13:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978810#M95630</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2007-04-12T13:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978811#M95631</link>
      <description>Well then, &lt;BR /&gt;it looks like the Linux version has figured out how to ignore the repeatiing series of "-v" to make it work...&lt;BR /&gt;&lt;BR /&gt;thanks all for the clarification,&lt;BR /&gt;and I see that re-reading Dennis' post, he didn't repeat the "-v" over and over again.&lt;BR /&gt;&lt;BR /&gt;Sorry Dennis, wish they had a do-over button on the points.</description>
      <pubDate>Thu, 12 Apr 2007 13:31:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978811#M95631</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-04-12T13:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: a better way to exclude items other than a series of "grep -v" piped commands</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978812#M95632</link>
      <description>&amp;gt;I see that re-reading Dennis' post, he didn't repeat the "-v" over and over again.&lt;BR /&gt;&lt;BR /&gt;I would assume you could repeat it and work, but I'm lazy.  You just can't put the -v after the -e.&lt;BR /&gt;&lt;BR /&gt;Ah, you're right, there is a bug in grep.  They just increment vflag then they do bit stuff on it.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Sorry Dennis, wish they had a do-over button on the points.&lt;BR /&gt;&lt;BR /&gt;Ok, you can add the rest here.  :-)&lt;BR /&gt;So you don't feel short changed, I filed a bug report on it:&lt;BR /&gt;CR JAGag37626:&lt;BR /&gt;Multiple -v in grep cause all to be ignored</description>
      <pubDate>Thu, 12 Apr 2007 17:38:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-better-way-to-exclude-items-other-than-a-series-of-quot-grep-v/m-p/3978812#M95632</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-12T17:38:16Z</dc:date>
    </item>
  </channel>
</rss>

