<?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: how to 'grep' !! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056716#M305380</link>
    <description>u should use grep -x apple testfile.&lt;BR /&gt;see man grep</description>
    <pubDate>Mon, 20 Aug 2007 01:15:17 GMT</pubDate>
    <dc:creator>AwadheshPandey</dc:creator>
    <dc:date>2007-08-20T01:15:17Z</dc:date>
    <item>
      <title>how to 'grep' !!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056714#M305378</link>
      <description>Admins,&lt;BR /&gt;&lt;BR /&gt; Assume below 'testfile' contains (5 lines),&lt;BR /&gt;&lt;BR /&gt;&amp;gt; cat testfile&lt;BR /&gt;apple&lt;BR /&gt;apple1&lt;BR /&gt;apple2&lt;BR /&gt;apple3&lt;BR /&gt;apple4&lt;BR /&gt;apple5&lt;BR /&gt;&lt;BR /&gt; Qn: Is there anyways I can "grep" only the word "apple". Like,&lt;BR /&gt;&lt;BR /&gt;# grep -? "apple" testfile&lt;BR /&gt;&lt;BR /&gt;I need the output only as "apple".&lt;BR /&gt;&lt;BR /&gt;--WH&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Aug 2007 00:34:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056714#M305378</guid>
      <dc:creator>Whitehorse_1</dc:creator>
      <dc:date>2007-08-20T00:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to 'grep' !!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056715#M305379</link>
      <description>Simply use an anchor&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;$ grep 'apple$' testfile&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Aug 2007 01:04:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056715#M305379</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2007-08-20T01:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to 'grep' !!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056716#M305380</link>
      <description>u should use grep -x apple testfile.&lt;BR /&gt;see man grep</description>
      <pubDate>Mon, 20 Aug 2007 01:15:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056716#M305380</guid>
      <dc:creator>AwadheshPandey</dc:creator>
      <dc:date>2007-08-20T01:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to 'grep' !!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056717#M305381</link>
      <description>Addendum,&lt;BR /&gt;because a string like "apple" might not be the last string of a record in a file one likely more often has some following fields separated by whitespace or some other separator.&lt;BR /&gt;In such a case you could use the extended regexp engine of grep and use something similar to this&lt;BR /&gt;&lt;BR /&gt;$ grep -E 'apple[^[:alnum:]]+'&lt;BR /&gt;&lt;BR /&gt;grep -E or egrep can cope with much more intricate filters (see man regexp).&lt;BR /&gt;Albeit, the scope of grep is a bit limited and sometimes one needs a sharper tool like Perl which deserved much of its fame from its intrinsic regular expression capabilities.&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Aug 2007 01:20:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056717#M305381</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2007-08-20T01:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to 'grep' !!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056718#M305382</link>
      <description>Thxs Ralph and Awad.. &lt;BR /&gt;&lt;BR /&gt;Qn2: If my file contains,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;cat testfile&lt;BR /&gt;one&lt;BR /&gt;two&lt;BR /&gt;three&lt;BR /&gt;four&lt;BR /&gt;five&lt;BR /&gt;&lt;BR /&gt; How can I grep the words "one" "three" and "four" using a single "grep" command, like,&lt;BR /&gt;&lt;BR /&gt; #grep -? -? "one" -? "three" -? "four"&lt;BR /&gt;&lt;BR /&gt;--WH</description>
      <pubDate>Mon, 20 Aug 2007 02:20:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056718#M305382</guid>
      <dc:creator>Whitehorse_1</dc:creator>
      <dc:date>2007-08-20T02:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to 'grep' !!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056719#M305383</link>
      <description>Hey&lt;BR /&gt;&lt;BR /&gt;$ cat yourfile | grep -E "one|three|four"&lt;BR /&gt;&lt;BR /&gt;see also man regexp&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 20 Aug 2007 02:24:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056719#M305383</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2007-08-20T02:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to 'grep' !!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056720#M305384</link>
      <description>Use :&lt;BR /&gt;&lt;BR /&gt;cat file| grep -e expr1 -e expr2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;grep -e "one" -e "three"  -e "four"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ivan</description>
      <pubDate>Mon, 20 Aug 2007 02:27:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056720#M305384</guid>
      <dc:creator>Ivan Krastev</dc:creator>
      <dc:date>2007-08-20T02:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to 'grep' !!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056721#M305385</link>
      <description>u can also use a loop for that,&lt;BR /&gt;for i in one three four&lt;BR /&gt;do&lt;BR /&gt;grep $i testfile&lt;BR /&gt;done</description>
      <pubDate>Mon, 20 Aug 2007 02:30:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056721#M305385</guid>
      <dc:creator>AwadheshPandey</dc:creator>
      <dc:date>2007-08-20T02:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to 'grep' !!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056722#M305386</link>
      <description>Hi,&lt;BR /&gt; &lt;BR /&gt;You can just check this command&lt;BR /&gt;&lt;BR /&gt;cat testfile | grep -i apple&lt;BR /&gt;&lt;BR /&gt;"i" makes it case insensitive.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanx&lt;BR /&gt;&lt;BR /&gt;Rahul</description>
      <pubDate>Mon, 20 Aug 2007 05:37:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056722#M305386</guid>
      <dc:creator>ROCK_10</dc:creator>
      <dc:date>2007-08-20T05:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to 'grep' !!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056723#M305387</link>
      <description>You can of course use grep -w, which is made for what you want.&lt;BR /&gt;&lt;BR /&gt;Contrary to what Rahul, Oviwan and Ivan used, you don't have to use cat with grep.  grep takes a list of files.</description>
      <pubDate>Mon, 20 Aug 2007 06:22:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056723#M305387</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-08-20T06:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to 'grep' !!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056724#M305388</link>
      <description>As Ralph corrected himself, the anchor idea is of adequate, but gets mighty combersome for general case where one has to allow for whitespace surrounding it, and begin of line and end of line and what about quotes?&lt;BR /&gt;&lt;BR /&gt;The grep -w option tends to work great, if your grep supports it at all.&lt;BR /&gt;&lt;BR /&gt;Personally I mostly use perl to do my greps and more.&lt;BR /&gt;Perl as a "\b" escape for "boundary"&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;$ cat &amp;gt; x&lt;BR /&gt;apple&lt;BR /&gt;apple1&lt;BR /&gt;apple2&lt;BR /&gt;apple3&lt;BR /&gt;snapple&lt;BR /&gt;an apple a day&lt;BR /&gt;quoted 'apple' test&lt;BR /&gt;double-quoted "apple" test&lt;BR /&gt;$ perl -ne "print if /\bapple\b/" x&lt;BR /&gt;apple&lt;BR /&gt;an apple a day&lt;BR /&gt;quoted 'apple' test&lt;BR /&gt;double-quoted "apple" test&lt;BR /&gt;&lt;BR /&gt;Enjoy.&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Aug 2007 07:53:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-grep/m-p/4056724#M305388</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-08-20T07:53:46Z</dc:date>
    </item>
  </channel>
</rss>

