<?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 and whole words in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/grep-and-whole-words/m-p/2869332#M77909</link>
    <description>you can pipe it to head&lt;BR /&gt;&lt;BR /&gt;like&lt;BR /&gt;&lt;BR /&gt;/tmp/a &lt;BR /&gt;&lt;BR /&gt;--------- &lt;BR /&gt;/test &lt;BR /&gt;/test/hello &lt;BR /&gt;/testA &lt;BR /&gt;----------&lt;BR /&gt;&lt;BR /&gt;cat /tmp/a|grep test |head -1</description>
    <pubDate>Mon, 23 Dec 2002 13:56:12 GMT</pubDate>
    <dc:creator>T G Manikandan</dc:creator>
    <dc:date>2002-12-23T13:56:12Z</dc:date>
    <item>
      <title>grep and whole words</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-and-whole-words/m-p/2869331#M77908</link>
      <description>Hello:&lt;BR /&gt;&lt;BR /&gt;   imagine the next file&lt;BR /&gt;---------&lt;BR /&gt;/test&lt;BR /&gt;/test/hello&lt;BR /&gt;/testA&lt;BR /&gt;---------&lt;BR /&gt;   I need to make a grep over it to obtain only the first entry(/test). If I use the -w option I get the following&lt;BR /&gt;/test&lt;BR /&gt;/test/hello&lt;BR /&gt;&lt;BR /&gt;   This must be easy but I don??t know how to do it.&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Mon, 23 Dec 2002 10:07:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-and-whole-words/m-p/2869331#M77908</guid>
      <dc:creator>oiram</dc:creator>
      <dc:date>2002-12-23T10:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: grep and whole words</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-and-whole-words/m-p/2869332#M77909</link>
      <description>you can pipe it to head&lt;BR /&gt;&lt;BR /&gt;like&lt;BR /&gt;&lt;BR /&gt;/tmp/a &lt;BR /&gt;&lt;BR /&gt;--------- &lt;BR /&gt;/test &lt;BR /&gt;/test/hello &lt;BR /&gt;/testA &lt;BR /&gt;----------&lt;BR /&gt;&lt;BR /&gt;cat /tmp/a|grep test |head -1</description>
      <pubDate>Mon, 23 Dec 2002 13:56:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-and-whole-words/m-p/2869332#M77909</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2002-12-23T13:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: grep and whole words</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-and-whole-words/m-p/2869333#M77910</link>
      <description>With what you've shown here you can get the results you want with an end-of-line metacharacter.  Your grep command would look like&lt;BR /&gt;&lt;BR /&gt;grep "/test$" myfile&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;ard</description>
      <pubDate>Mon, 23 Dec 2002 16:21:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-and-whole-words/m-p/2869333#M77910</guid>
      <dc:creator>Alan Deger</dc:creator>
      <dc:date>2002-12-23T16:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: grep and whole words</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-and-whole-words/m-p/2869334#M77911</link>
      <description>If you really want to worry about "words" and assume that the word delimeter is white space (tab or blank), then a more complete expression would be:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;grep -E '/test$|/test[[:space:]]' /tmp/x&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This checks for the word "/test" at the end of line *or* followed by a whitespace char.&lt;BR /&gt;&lt;BR /&gt;E.g., for the file:&lt;BR /&gt;# cat /tmp/x&lt;BR /&gt;/test &lt;BR /&gt;/test one blank&lt;BR /&gt;/test  2 blanks&lt;BR /&gt;/test   tab&lt;BR /&gt;/test/hello &lt;BR /&gt;/testA &lt;BR /&gt;&lt;BR /&gt;the results are:&lt;BR /&gt;&lt;BR /&gt;# grep -E '/test[[:space:]]|/test$' /tmp/x&lt;BR /&gt;/test &lt;BR /&gt;/test one blank&lt;BR /&gt;/test  2 blanks&lt;BR /&gt;/test   tab&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;bv</description>
      <pubDate>Tue, 24 Dec 2002 14:37:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-and-whole-words/m-p/2869334#M77911</guid>
      <dc:creator>Bob_Vance</dc:creator>
      <dc:date>2002-12-24T14:37:46Z</dc:date>
    </item>
  </channel>
</rss>

