<?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: help on grep command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496526#M830359</link>
    <description>I think I saw on a previous post that there is a '-x' option to grep that lets you grep for exact matches.&lt;BR /&gt;&lt;BR /&gt;So the following:&lt;BR /&gt;&lt;BR /&gt;grep -x ab testfile</description>
    <pubDate>Wed, 21 Feb 2001 03:57:01 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2001-02-21T03:57:01Z</dc:date>
    <item>
      <title>help on grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496524#M830357</link>
      <description>Is there an option for grep on hpux to search for (just) a word? Suppose a file contains the ff.&lt;BR /&gt;&lt;BR /&gt;line 1:abc def gef&lt;BR /&gt;line 2:ab cdef hig&lt;BR /&gt;&lt;BR /&gt;How could grep search for the word "ab" only (on line 2) and ignore "abc" (on line 1)?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Wed, 21 Feb 2001 02:58:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496524#M830357</guid>
      <dc:creator>Alan Buenaventura</dc:creator>
      <dc:date>2001-02-21T02:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: help on grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496525#M830358</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;egrep -e " ab |^ab | ab$"  &lt;FILENAME&gt;&lt;BR /&gt;&lt;BR /&gt;Note that first condition has blank space before ab and after ab . &lt;BR /&gt;&lt;BR /&gt;Second condition has a blank space at end .&lt;BR /&gt;&lt;BR /&gt;Third condition has blank space in front.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;/FILENAME&gt;</description>
      <pubDate>Wed, 21 Feb 2001 03:48:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496525#M830358</guid>
      <dc:creator>Vikas Khator</dc:creator>
      <dc:date>2001-02-21T03:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: help on grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496526#M830359</link>
      <description>I think I saw on a previous post that there is a '-x' option to grep that lets you grep for exact matches.&lt;BR /&gt;&lt;BR /&gt;So the following:&lt;BR /&gt;&lt;BR /&gt;grep -x ab testfile</description>
      <pubDate>Wed, 21 Feb 2001 03:57:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496526#M830359</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-02-21T03:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: help on grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496527#M830360</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;According to the man page for grep(1), the -x option matches the entire line, not a whitespace delimited word.  Sorry,&lt;BR /&gt;&lt;BR /&gt;--Bruce</description>
      <pubDate>Wed, 21 Feb 2001 04:48:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496527#M830360</guid>
      <dc:creator>Bruce Regittko_1</dc:creator>
      <dc:date>2001-02-21T04:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: help on grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496528#M830361</link>
      <description>Hi Alan,&lt;BR /&gt;&lt;BR /&gt;Victor's suggestion is good, but a more general approach would be with using regular expressions character classes:&lt;BR /&gt;(see man 5 regexp for details)&lt;BR /&gt;&lt;BR /&gt;echo "ab c def ghi" | grep -e "[[:space:]]ab[[:space:]]|^ab[[:space:]]|[[:space:]]ab$"&lt;BR /&gt;&lt;BR /&gt;The [:space:] character class matches all characters producing white space on the displayed text&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Dan&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Feb 2001 06:49:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496528#M830361</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2001-02-21T06:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: help on grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496529#M830362</link>
      <description>grep 'ab ' filename</description>
      <pubDate>Wed, 21 Feb 2001 16:21:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-on-grep-command/m-p/2496529#M830362</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-02-21T16:21:36Z</dc:date>
    </item>
  </channel>
</rss>

