<?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: Grep on fixed value in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502095#M680883</link>
    <description>After 11.11 the grep command has the -w option which greps for whole word only and will work if the work hello had leading and trailing spaces as well.&lt;BR /&gt;grep -w hello hello-file&lt;BR /&gt;</description>
    <pubDate>Wed, 23 Sep 2009 11:41:23 GMT</pubDate>
    <dc:creator>TTr</dc:creator>
    <dc:date>2009-09-23T11:41:23Z</dc:date>
    <item>
      <title>Grep on fixed value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502091#M680879</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have a file like this:&lt;BR /&gt;&lt;BR /&gt;hello&lt;BR /&gt;hello123&lt;BR /&gt;hello345&lt;BR /&gt;hello678&lt;BR /&gt;&lt;BR /&gt;I want to grep on "hello" and only output the first line.  So I want to grep for "hello" as a fixed or absolute value.</description>
      <pubDate>Wed, 23 Sep 2009 11:17:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502091#M680879</guid>
      <dc:creator>dev44</dc:creator>
      <dc:date>2009-09-23T11:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Grep on fixed value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502092#M680880</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Anchor the pattern:&lt;BR /&gt;&lt;BR /&gt;# grep ^hello$ file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 23 Sep 2009 11:22:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502092#M680880</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-09-23T11:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Grep on fixed value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502093#M680881</link>
      <description>It came back with no ouput at all.</description>
      <pubDate>Wed, 23 Sep 2009 11:26:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502093#M680881</guid>
      <dc:creator>dev44</dc:creator>
      <dc:date>2009-09-23T11:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Grep on fixed value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502094#M680882</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; It came back with no output at all.&lt;BR /&gt;&lt;BR /&gt;Then there is probably whitespace before and/or after the "hello" token.  This is easy to fix:&lt;BR /&gt;&lt;BR /&gt;# perl -ne 'm{^\s*hello\s*$} and print' file&lt;BR /&gt;&lt;BR /&gt;The '\s' denotes whitespace (spaces, tabs).  The anchors (^ and $) make sure that the spaces are the ONLY characters preceding or trailing the token to match.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 23 Sep 2009 11:32:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502094#M680882</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-09-23T11:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Grep on fixed value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502095#M680883</link>
      <description>After 11.11 the grep command has the -w option which greps for whole word only and will work if the work hello had leading and trailing spaces as well.&lt;BR /&gt;grep -w hello hello-file&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Sep 2009 11:41:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502095#M680883</guid>
      <dc:creator>TTr</dc:creator>
      <dc:date>2009-09-23T11:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Grep on fixed value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502096#M680884</link>
      <description>&amp;gt;JFR: Anchor the pattern: grep ^hello$ file&lt;BR /&gt;&lt;BR /&gt;Instead of doing that you could use -x.&lt;BR /&gt;Since you don't have a pattern you can just use fgrep -x.  Except as JRF said, you seem to have trailing spaces, so you can use grep -w as TTr mentioned.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Sep 2009 14:01:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-on-fixed-value/m-p/4502096#M680884</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-09-23T14:01:57Z</dc:date>
    </item>
  </channel>
</rss>

