<?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: egrep question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276928#M657416</link>
    <description>Heed Steven's advice.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; I want to egrep for two different words in a single line using egrep. &lt;BR /&gt;&lt;BR /&gt;Hmmm, why would one feel one should use 'egrep'  (fill in any other forcibly chosen tool) if one, apparently, does not know it well enough?&lt;BR /&gt;&lt;BR /&gt;This _might_ be better solved with AWK&lt;BR /&gt;&lt;BR /&gt;$ awk '/allan/ &amp;amp;&amp;amp; /great/'  your-file.txt&lt;BR /&gt;&lt;BR /&gt;or perl&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ perl -ne 'print if /allan/ &amp;amp;&amp;amp; /great/' your-file.txt&lt;BR /&gt;&lt;BR /&gt;more perl, written more silly ...&lt;BR /&gt;&lt;BR /&gt;$ perl -ne '/allan/ &amp;amp;&amp;amp; /great/ &amp;amp;&amp;amp; print' your-file.txt&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.</description>
    <pubDate>Thu, 17 Mar 2011 03:19:08 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2011-03-17T03:19:08Z</dc:date>
    <item>
      <title>egrep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276925#M657413</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;I want to egrep for two different words in a single line using egrep. &lt;BR /&gt;&lt;BR /&gt;lets say line is - &lt;BR /&gt;&lt;BR /&gt;allan is a great man &lt;BR /&gt;&lt;BR /&gt;egrep for allan and great in the same line else dont print that line.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
      <pubDate>Thu, 17 Mar 2011 00:22:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276925#M657413</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2011-03-17T00:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: egrep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276926#M657414</link>
      <description>Hi Allan:&lt;BR /&gt;&lt;BR /&gt;If you want and AND relationship where both strings match:&lt;BR /&gt;&lt;BR /&gt;# echo "allan is a great man"|grep allan|grep great   &lt;BR /&gt;&lt;BR /&gt;...but if you want an OR (alternation) where only one string need match:&lt;BR /&gt;&lt;BR /&gt;# echo "allan is a great man"|grep -E "allan|great"&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 17 Mar 2011 00:33:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276926#M657414</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-17T00:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: egrep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276927#M657415</link>
      <description>&lt;!--!*#--&gt;&amp;gt; # echo "allan is a great man"|grep allan|grep great&lt;BR /&gt;&lt;BR /&gt;Two "grep" processes?  Ptui.  Make one&lt;BR /&gt;process work harder:&lt;BR /&gt;&lt;BR /&gt;alp$ echo 'allan is a great man' | egrep -e 'allan.*great|great.*allan'&lt;BR /&gt;allan is a great man&lt;BR /&gt;&lt;BR /&gt;alp$ echo 'a great man is allan' | egrep -e 'allan.*great|great.*allan'&lt;BR /&gt;a great man is allan&lt;BR /&gt;&lt;BR /&gt;As usual, everything's complicated, and the&lt;BR /&gt;fine print may matter.  Case?  Distinct&lt;BR /&gt;words, or strings anywhere?&lt;BR /&gt;&lt;BR /&gt;alp$ echo 'greater gallantry' | egrep -e 'allan.*great|great.*allan'&lt;BR /&gt;greater gallantry&lt;BR /&gt;&lt;BR /&gt;Of course, if the order is known, then the&lt;BR /&gt;regular expression could be simplified.</description>
      <pubDate>Thu, 17 Mar 2011 02:56:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276927#M657415</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-17T02:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: egrep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276928#M657416</link>
      <description>Heed Steven's advice.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; I want to egrep for two different words in a single line using egrep. &lt;BR /&gt;&lt;BR /&gt;Hmmm, why would one feel one should use 'egrep'  (fill in any other forcibly chosen tool) if one, apparently, does not know it well enough?&lt;BR /&gt;&lt;BR /&gt;This _might_ be better solved with AWK&lt;BR /&gt;&lt;BR /&gt;$ awk '/allan/ &amp;amp;&amp;amp; /great/'  your-file.txt&lt;BR /&gt;&lt;BR /&gt;or perl&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ perl -ne 'print if /allan/ &amp;amp;&amp;amp; /great/' your-file.txt&lt;BR /&gt;&lt;BR /&gt;more perl, written more silly ...&lt;BR /&gt;&lt;BR /&gt;$ perl -ne '/allan/ &amp;amp;&amp;amp; /great/ &amp;amp;&amp;amp; print' your-file.txt&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.</description>
      <pubDate>Thu, 17 Mar 2011 03:19:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276928#M657416</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2011-03-17T03:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: egrep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276929#M657417</link>
      <description>great discussion!&lt;BR /&gt;&lt;BR /&gt;Thanks guys&lt;BR /&gt;&lt;BR /&gt;Allan.</description>
      <pubDate>Thu, 17 Mar 2011 04:03:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276929#M657417</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2011-03-17T04:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: egrep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276930#M657418</link>
      <description>&amp;gt;I want to egrep for two different words in a single line using egrep.&lt;BR /&gt;&lt;BR /&gt;Why would you want to use the egrep hammer if you can use grep instead?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;egrep for allan and great in the same line&lt;BR /&gt;&lt;BR /&gt;You can use this if you don't want a grep pipeline:&lt;BR /&gt;grep -e "allan.*great" -e "great.*allan"</description>
      <pubDate>Thu, 17 Mar 2011 06:45:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/egrep-question/m-p/5276930#M657418</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-17T06:45:14Z</dc:date>
    </item>
  </channel>
</rss>

