<?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 question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365925#M867167</link>
    <description>Try &lt;BR /&gt;&lt;BR /&gt;grep " ABC " test&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
    <pubDate>Thu, 26 Aug 2004 10:29:24 GMT</pubDate>
    <dc:creator>Pete Randall</dc:creator>
    <dc:date>2004-08-26T10:29:24Z</dc:date>
    <item>
      <title>Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365922#M867164</link>
      <description>I am trying to grep for a word ABC in a line withn a file&lt;BR /&gt;The file test contains&lt;BR /&gt;The word is ABC &lt;BR /&gt;Something ABC.orig&lt;BR /&gt;when i do grep ABC test|wc -l . It returns 2 &lt;BR /&gt;Is there any way i could grep for the exact word ABC?</description>
      <pubDate>Thu, 26 Aug 2004 10:22:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365922#M867164</guid>
      <dc:creator>Sachin_29</dc:creator>
      <dc:date>2004-08-26T10:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365923#M867165</link>
      <description>If ABC.orig is also in that file you can try :&lt;BR /&gt;&lt;BR /&gt;grep ABC test|grep -v ABC.orig | wc -l&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Aug 2004 10:26:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365923#M867165</guid>
      <dc:creator>Carlo Corthouts</dc:creator>
      <dc:date>2004-08-26T10:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365924#M867166</link>
      <description>sorry i meant there could be more words where like ABC.dontknow ABC234 etc</description>
      <pubDate>Thu, 26 Aug 2004 10:28:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365924#M867166</guid>
      <dc:creator>Sachin_29</dc:creator>
      <dc:date>2004-08-26T10:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365925#M867167</link>
      <description>Try &lt;BR /&gt;&lt;BR /&gt;grep " ABC " test&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 26 Aug 2004 10:29:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365925#M867167</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-08-26T10:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365926#M867168</link>
      <description>grep -x [A]BC file&lt;BR /&gt;&lt;BR /&gt;Else get GNU grep.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Thu, 26 Aug 2004 10:31:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365926#M867168</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-08-26T10:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365927#M867169</link>
      <description>doesnt help pete!!!</description>
      <pubDate>Thu, 26 Aug 2004 10:31:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365927#M867169</guid>
      <dc:creator>Sachin_29</dc:creator>
      <dc:date>2004-08-26T10:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365928#M867170</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;just &lt;BR /&gt;&lt;BR /&gt;grep " ABC" test&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Franky</description>
      <pubDate>Thu, 26 Aug 2004 10:32:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365928#M867170</guid>
      <dc:creator>Franky_1</dc:creator>
      <dc:date>2004-08-26T10:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365929#M867171</link>
      <description>Try grep -w ABC</description>
      <pubDate>Thu, 26 Aug 2004 10:32:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365929#M867171</guid>
      <dc:creator>Carlo Corthouts</dc:creator>
      <dc:date>2004-08-26T10:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365930#M867172</link>
      <description>You'll need anchors: -&lt;BR /&gt;&lt;BR /&gt;If you want to grep for ABC as part of a line: -&lt;BR /&gt;&lt;BR /&gt;grep " ABC " file (note the spaces)&lt;BR /&gt;&lt;BR /&gt;If you want a line with ONLY ABC: -&lt;BR /&gt;&lt;BR /&gt;grep "^ABC$" file (^ anchors start of line, $ anchors end)</description>
      <pubDate>Thu, 26 Aug 2004 10:32:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365930#M867172</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2004-08-26T10:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365931#M867173</link>
      <description>If you want to anchor to spaces AND tabs (which may be valid depending on your file), then: -&lt;BR /&gt;&lt;BR /&gt;grep "[ |    ]ABC[ |    ]" file&lt;BR /&gt;&lt;BR /&gt;Where the brackets contain "space pipe tab"</description>
      <pubDate>Thu, 26 Aug 2004 10:35:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365931#M867173</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2004-08-26T10:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365932#M867174</link>
      <description>`grep -x` will do an EXACT match.</description>
      <pubDate>Thu, 26 Aug 2004 10:35:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365932#M867174</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2004-08-26T10:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365933#M867175</link>
      <description>How about:&lt;BR /&gt;&lt;BR /&gt;grep -e " ABC " -e " ABC$" -e "^ABC " -e "^ABC$"&lt;BR /&gt;&lt;BR /&gt;That will find:&lt;BR /&gt;1.  ABC surrounded by spaces.&lt;BR /&gt;2.  ABC ending a line&lt;BR /&gt;3.  ABC starting a line&lt;BR /&gt;4.  A line consisting only of ABC&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
      <pubDate>Thu, 26 Aug 2004 10:36:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365933#M867175</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2004-08-26T10:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365934#M867176</link>
      <description>Or you can do &lt;BR /&gt;&lt;BR /&gt;#man grep</description>
      <pubDate>Thu, 26 Aug 2004 10:37:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365934#M867176</guid>
      <dc:creator>Carlo Corthouts</dc:creator>
      <dc:date>2004-08-26T10:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365935#M867177</link>
      <description>John I am getting Illegal Variable name?</description>
      <pubDate>Thu, 26 Aug 2004 10:39:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365935#M867177</guid>
      <dc:creator>Sachin_29</dc:creator>
      <dc:date>2004-08-26T10:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365936#M867178</link>
      <description>The best solution then is the grep -x syntax.&lt;BR /&gt;$ grep -x ABC test&lt;BR /&gt;ABC&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 26 Aug 2004 10:50:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365936#M867178</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-08-26T10:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365937#M867179</link>
      <description>Pete:&lt;BR /&gt;the grep -x ABC doesnt work as it looks for the exact line ..the lines are "The word is ABC" and "Something ABC.orig" so if i do grep -x ABC test|wc -l it returns 0</description>
      <pubDate>Thu, 26 Aug 2004 10:53:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365937#M867179</guid>
      <dc:creator>Sachin_29</dc:creator>
      <dc:date>2004-08-26T10:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365938#M867180</link>
      <description>The grep -x does not look for exact lines, it looks for exact patterns.&lt;BR /&gt;&lt;BR /&gt;If you have ABC on a line then grep -x ABC &lt;FILE&gt; will match. If ABC has multiple and different patterns then the grep -x will not match.&lt;/FILE&gt;</description>
      <pubDate>Thu, 26 Aug 2004 11:01:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365938#M867180</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2004-08-26T11:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365939#M867181</link>
      <description>grep -w [A]BC&lt;BR /&gt;&lt;BR /&gt;Else get GNU grep&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Thu, 26 Aug 2004 11:06:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365939#M867181</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-08-26T11:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365940#M867182</link>
      <description>hey&lt;BR /&gt;grep ABC$ test works</description>
      <pubDate>Thu, 26 Aug 2004 11:06:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365940#M867182</guid>
      <dc:creator>Sachin_29</dc:creator>
      <dc:date>2004-08-26T11:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Grep question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365941#M867183</link>
      <description>The problem is in the different possibilities of a "word". Typically, a word is defined as text surrounded by whitespace. ABC on a line all by iteself is followed by the whitespace character NEWLINE. In your working example ABC$, grep is looking for ABC at the exact end of the line. ABC$ will not find ABC followed by a space or any other character. The -w option is only for current patches for grep but should work for your requirement.</description>
      <pubDate>Thu, 26 Aug 2004 11:23:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-question/m-p/3365941#M867183</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-08-26T11:23:25Z</dc:date>
    </item>
  </channel>
</rss>

