<?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 grep for multiple patterns in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897222#M701403</link>
    <description>Hi all:&lt;BR /&gt;&lt;BR /&gt;Quick question on the use of 'grep'&lt;BR /&gt;&lt;BR /&gt;I have a need to do multiple greps of processes from the command line. Each pattern will be different but I have to check for the occurance of any of these patterns.&lt;BR /&gt;&lt;BR /&gt;I have tried&lt;BR /&gt;  ps -ef | grep a b c d e&lt;BR /&gt;Responds that "grep can't open b c d e"&lt;BR /&gt;&lt;BR /&gt;Would I need to do;&lt;BR /&gt;  ps -ef | grep a | grep b | grep c | grep d&lt;BR /&gt;Or is there a better way?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
    <pubDate>Wed, 20 Apr 2005 11:55:30 GMT</pubDate>
    <dc:creator>Rick Garland</dc:creator>
    <dc:date>2005-04-20T11:55:30Z</dc:date>
    <item>
      <title>grep for multiple patterns</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897222#M701403</link>
      <description>Hi all:&lt;BR /&gt;&lt;BR /&gt;Quick question on the use of 'grep'&lt;BR /&gt;&lt;BR /&gt;I have a need to do multiple greps of processes from the command line. Each pattern will be different but I have to check for the occurance of any of these patterns.&lt;BR /&gt;&lt;BR /&gt;I have tried&lt;BR /&gt;  ps -ef | grep a b c d e&lt;BR /&gt;Responds that "grep can't open b c d e"&lt;BR /&gt;&lt;BR /&gt;Would I need to do;&lt;BR /&gt;  ps -ef | grep a | grep b | grep c | grep d&lt;BR /&gt;Or is there a better way?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Wed, 20 Apr 2005 11:55:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897222#M701403</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-04-20T11:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: grep for multiple patterns</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897223#M701404</link>
      <description>Not completely sure on what you want??&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep 'a b c d e'&lt;BR /&gt;ps -ef | egrep "a|b|c|d|e"&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Wed, 20 Apr 2005 11:59:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897223#M701404</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-04-20T11:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: grep for multiple patterns</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897224#M701405</link>
      <description>egrep!&lt;BR /&gt;&lt;BR /&gt;ps -ef |egrep -i 'a|b|c|d'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Wed, 20 Apr 2005 12:00:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897224#M701405</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-04-20T12:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: grep for multiple patterns</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897225#M701406</link>
      <description>Rick,&lt;BR /&gt;&lt;BR /&gt;I think extended regular expressions (ERE) are what you're looking for:&lt;BR /&gt;&lt;BR /&gt;ps -ef |grep -e "a" -e "b" -e "c" -e "d" -e "e"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 20 Apr 2005 12:00:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897225#M701406</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-04-20T12:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: grep for multiple patterns</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897226#M701407</link>
      <description># grep -e pat1 -e pat2 -e pat3 file&lt;BR /&gt;&lt;BR /&gt;greps pat1 OR pat2 OR pat3 OR pat5&lt;BR /&gt;&lt;BR /&gt;# grep pat1 file | grep pat2 | grep pat3&lt;BR /&gt;&lt;BR /&gt;greps pat1 AND pat2 AND pat3&lt;BR /&gt;&lt;BR /&gt;# grep -e pat1 -e pat2 file | grep pat3&lt;BR /&gt;&lt;BR /&gt;greps (pat1 OR pat2) AND pat3&lt;BR /&gt;&lt;BR /&gt;# perl -ne'/pat1/||/pat2/||/pat3/and print'&lt;BR /&gt;&lt;BR /&gt;pat1 OR pat2 OR pat3&lt;BR /&gt;&lt;BR /&gt;# perl -ne'(/pat1/||/pat2/)&amp;amp;&amp;amp;/pat3/and print'&lt;BR /&gt;&lt;BR /&gt;(pat1 OR pat2) AND pat3&lt;BR /&gt;&lt;BR /&gt;etc etc ...&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Wed, 20 Apr 2005 12:03:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897226#M701407</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-04-20T12:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: grep for multiple patterns</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897227#M701408</link>
      <description>Many thanks all!</description>
      <pubDate>Wed, 20 Apr 2005 12:06:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-for-multiple-patterns/m-p/4897227#M701408</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-04-20T12:06:51Z</dc:date>
    </item>
  </channel>
</rss>

