<?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: multiple grep question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925006#M110435</link>
    <description>Try using egrep:&lt;BR /&gt;&lt;BR /&gt;wedny:/root=&amp;gt; ls |egrep -e "PHCO_27673" -e "lvmrc" -e "test1.txt"&lt;BR /&gt;PHCO_27673&lt;BR /&gt;PHCO_27673.depot&lt;BR /&gt;PHCO_27673.text&lt;BR /&gt;lvmrc&lt;BR /&gt;test1.txt&lt;BR /&gt;&lt;BR /&gt;Col.</description>
    <pubDate>Wed, 12 Mar 2003 10:48:29 GMT</pubDate>
    <dc:creator>Colin Topliss</dc:creator>
    <dc:date>2003-03-12T10:48:29Z</dc:date>
    <item>
      <title>multiple grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925005#M110434</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have approx. 6000 files &amp;amp; want to search for about 7 different numeric strings. Any ideas how this could be done?&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Wed, 12 Mar 2003 10:43:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925005#M110434</guid>
      <dc:creator>Edgar_10</dc:creator>
      <dc:date>2003-03-12T10:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: multiple grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925006#M110435</link>
      <description>Try using egrep:&lt;BR /&gt;&lt;BR /&gt;wedny:/root=&amp;gt; ls |egrep -e "PHCO_27673" -e "lvmrc" -e "test1.txt"&lt;BR /&gt;PHCO_27673&lt;BR /&gt;PHCO_27673.depot&lt;BR /&gt;PHCO_27673.text&lt;BR /&gt;lvmrc&lt;BR /&gt;test1.txt&lt;BR /&gt;&lt;BR /&gt;Col.</description>
      <pubDate>Wed, 12 Mar 2003 10:48:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925006#M110435</guid>
      <dc:creator>Colin Topliss</dc:creator>
      <dc:date>2003-03-12T10:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: multiple grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925007#M110436</link>
      <description>Identify your files and search them with grep. One way is to combine find and grep...&lt;BR /&gt;&lt;BR /&gt;find &lt;DIR&gt; &lt;OTHER find="" args=""&gt; -exec grep -e string1 -e string2 -e string3... {} \;&lt;BR /&gt;&lt;BR /&gt;If you only want to know which files contain one of the strings, supply the -l flag to grep.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John&lt;/OTHER&gt;&lt;/DIR&gt;</description>
      <pubDate>Wed, 12 Mar 2003 10:48:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925007#M110436</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2003-03-12T10:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: multiple grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925008#M110437</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;A number of ways exist, depending on where your files are located.  If they're all in one directory, then:&lt;BR /&gt;&lt;BR /&gt;grep -e 123 -e 456 -e 789 *&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;grep -E '(123|456|789)' *&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;create a file, say /tmp/strings containing the search strings and:&lt;BR /&gt;&lt;BR /&gt;grep -f /tmp/strings *&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If the files are in subdirectories, then:&lt;BR /&gt;&lt;BR /&gt;find /dir -type f | xargs grep -E '(123|456|789)'&lt;BR /&gt;&lt;BR /&gt;or any of the other greps above.&lt;BR /&gt;&lt;BR /&gt;rgds, Robin</description>
      <pubDate>Wed, 12 Mar 2003 10:53:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925008#M110437</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2003-03-12T10:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: multiple grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925009#M110438</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I use a script called findgrep:&lt;BR /&gt;&lt;BR /&gt;case $# in&lt;BR /&gt;  1)    cat /tmp/filelist | grep $1 ;;&lt;BR /&gt;  2)    cat /tmp/filelist | grep $1 | grep $2 ;;&lt;BR /&gt;  3)    cat /tmp/filelist | grep $1 | grep $2 | grep $3 ;;&lt;BR /&gt;  4)    cat /tmp/filelist | grep $1 | grep $2 | grep $3 | grep $4 ;;&lt;BR /&gt;  5)    cat /tmp/filelist | grep $1 | grep $2 | grep $3 | grep $4 | grep $5 ;;&lt;BR /&gt;  *)    echo " Thats much parameters " ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It makes use of a file /tmp/filelist. This file is made by a cron job which performs: find / -print &amp;gt; /tmp/filelist&lt;BR /&gt;&lt;BR /&gt;Thsi way the findgrep works very fast.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Donald</description>
      <pubDate>Wed, 12 Mar 2003 10:54:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925009#M110438</guid>
      <dc:creator>Donald Kok</dc:creator>
      <dc:date>2003-03-12T10:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: multiple grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925010#M110439</link>
      <description>ll|grep -Ei "you|me|they|anythingyouwant" /filename</description>
      <pubDate>Wed, 12 Mar 2003 10:55:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925010#M110439</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2003-03-12T10:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: multiple grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925011#M110440</link>
      <description>grep -Ei "you|me|they|anythingyouwant" /filename</description>
      <pubDate>Wed, 12 Mar 2003 10:55:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925011#M110440</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2003-03-12T10:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: multiple grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925012#M110441</link>
      <description>Use find command to parse out the 6000 files in the directory and the -exec option in find combined with grep -e to search each file.  For example:&lt;BR /&gt;&lt;BR /&gt;cd /dir&lt;BR /&gt;find . -name "file pattern" -exec grep -e string -e string.&lt;BR /&gt;&lt;BR /&gt;Modify your grep with:&lt;BR /&gt;-i = case insensative&lt;BR /&gt;-v = omit&lt;BR /&gt;&lt;BR /&gt;For example, your string has upper and lower case char.s:&lt;BR /&gt;&lt;BR /&gt;cd /dir&lt;BR /&gt;find . -name "file pattern" -exec grep -i -e string -e string.&lt;BR /&gt;&lt;BR /&gt;For example, you want to eliminate everything and take the remainder:&lt;BR /&gt;&lt;BR /&gt;cd /dir&lt;BR /&gt;find . -name "file pattern" -exec grep -v -e string -e string.&lt;BR /&gt;&lt;BR /&gt;For example, your string has upper and lower case char.s AND you want to eliminate everything and take the remainder:&lt;BR /&gt;&lt;BR /&gt;cd /dir&lt;BR /&gt;find . -name "file pattern" -exec grep -i -v -e string -e string.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Mar 2003 10:56:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925012#M110441</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-03-12T10:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: multiple grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925013#M110442</link>
      <description>Gees, you know, after all of that I forgot to close off the find command with curly brackets.&lt;BR /&gt;&lt;BR /&gt;cd /dir&lt;BR /&gt;find . -name "file pattern" -exec grep -v -e string -e string {} \;&lt;BR /&gt;&lt;BR /&gt;NOTE the end of all find is {} \;&lt;BR /&gt;&lt;BR /&gt;(* I hate that when it happens. :-) *)&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Mar 2003 10:58:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925013#M110442</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-03-12T10:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: multiple grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925014#M110443</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for the GREAT info!!&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Wed, 12 Mar 2003 11:24:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multiple-grep-question/m-p/2925014#M110443</guid>
      <dc:creator>Edgar_10</dc:creator>
      <dc:date>2003-03-12T11:24:24Z</dc:date>
    </item>
  </channel>
</rss>

