<?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 command help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207035#M464271</link>
    <description>I need to grep out a single word from a bunch of files under a directory. I also need to have the filename with it.&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; simple &lt;BR /&gt; # grep word * [inside the directory]&lt;BR /&gt;&lt;BR /&gt;Under /usr/tmp I have about 100 servers ....... may be present multiple times.&lt;BR /&gt;&lt;BR /&gt;Could not understand much perhaps you can grep out other stuffs from the above output.&lt;BR /&gt;Better you can use awk.&lt;BR /&gt;&lt;BR /&gt;BR,&lt;BR /&gt;Kapil+</description>
    <pubDate>Sat, 31 Oct 2009 00:57:45 GMT</pubDate>
    <dc:creator>Kapil Jha</dc:creator>
    <dc:date>2009-10-31T00:57:45Z</dc:date>
    <item>
      <title>grep command help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207031#M464267</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I need to grep out a single word from a bunch of files under a directory. I also need to have the filename with it.&lt;BR /&gt;Under /usr/tmp I have about 100 servers with the hostname. I need to grep out specific words from each server and the output needs to give the server name and the word. and if possible i need to have the word displayed only once for each server as the word may be present multiple times.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Fri, 30 Oct 2009 16:20:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207031#M464267</guid>
      <dc:creator>rhansen</dc:creator>
      <dc:date>2009-10-30T16:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: grep command help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207032#M464268</link>
      <description>The "grep -l singleword" will give you the filename if it finds the singleword in it. If the directory is flat you can use "grep -l singleword /pathto/directory/*" otherwise you have to descent to the subdirectories with "find".&lt;BR /&gt;&lt;BR /&gt;For running this process against 100 servers you have to run remsh to each server assuming you can do that without supplying a password.</description>
      <pubDate>Fri, 30 Oct 2009 16:57:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207032#M464268</guid>
      <dc:creator>TTr</dc:creator>
      <dc:date>2009-10-30T16:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: grep command help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207033#M464269</link>
      <description>"need to grep out a single word from a bunch of files...."&lt;BR /&gt;"/usr/tmp I have about 100 servers...."&lt;BR /&gt;"need to grep out specific words from each server...."&lt;BR /&gt;"server name and the word."&lt;BR /&gt;&lt;BR /&gt;I can't tell if this will meet your requirement or not:&lt;BR /&gt;&lt;BR /&gt;put your list of words in a file (let's call $HOME/pattern&lt;BR /&gt;&lt;BR /&gt;cd /usr/tmp&lt;BR /&gt;grep -f $HOME/pattern server* | sort -u&lt;BR /&gt;&lt;BR /&gt;you might have to futz with the "-w", "-i" or other flags...depending on whats actually in the file and what you want to see&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Oct 2009 16:57:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207033#M464269</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2009-10-30T16:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: grep command help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207034#M464270</link>
      <description>&lt;!--!*#--&gt;Non-psychics may need a clearer explanation&lt;BR /&gt;of what you have and what you wish to do with&lt;BR /&gt;it.  Particularly unclear:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Under /usr/tmp I have about 100 servers&lt;BR /&gt;&amp;gt; with the hostname.&lt;BR /&gt;&lt;BR /&gt;What does it mean to have a "server" under a&lt;BR /&gt;directory?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [... everything else ...]&lt;BR /&gt;&lt;BR /&gt;Perhaps some examples would be more helpful&lt;BR /&gt;than these vague and cryptic&lt;BR /&gt;non-descriptions.</description>
      <pubDate>Fri, 30 Oct 2009 23:05:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207034#M464270</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-10-30T23:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: grep command help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207035#M464271</link>
      <description>I need to grep out a single word from a bunch of files under a directory. I also need to have the filename with it.&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; simple &lt;BR /&gt; # grep word * [inside the directory]&lt;BR /&gt;&lt;BR /&gt;Under /usr/tmp I have about 100 servers ....... may be present multiple times.&lt;BR /&gt;&lt;BR /&gt;Could not understand much perhaps you can grep out other stuffs from the above output.&lt;BR /&gt;Better you can use awk.&lt;BR /&gt;&lt;BR /&gt;BR,&lt;BR /&gt;Kapil+</description>
      <pubDate>Sat, 31 Oct 2009 00:57:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207035#M464271</guid>
      <dc:creator>Kapil Jha</dc:creator>
      <dc:date>2009-10-31T00:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: grep command help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207036#M464272</link>
      <description>rhansen,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;Under /usr/tmp I have about 100 servers with the hostname. I need to grep out specific words...&lt;BR /&gt;&lt;BR /&gt;- server is a physical thing. You cant keep it under /usr/tmp. &lt;BR /&gt;&lt;BR /&gt;You can grep , may be you can use some regular expression, and sort it , use uniqe ,and pase it out.&lt;BR /&gt;&lt;BR /&gt;If you could , put some pattern of your file here, and take some time to describe the pattern you want in the output. That will make more sense to provide some good reply.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hth,&lt;BR /&gt;Raj.</description>
      <pubDate>Sat, 31 Oct 2009 02:49:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207036#M464272</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2009-10-31T02:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: grep command help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207037#M464273</link>
      <description>&amp;gt;need to grep out a single word from a bunch of files under a directory. I also need to have the filename with it.&lt;BR /&gt;&lt;BR /&gt;Adding to what TTr said, you may want to use -w for a delimited match:&lt;BR /&gt;grep -l -w singleword&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Under /usr/tmp I have about 100 servers&lt;BR /&gt;&lt;BR /&gt;Is this a different question?&lt;BR /&gt;Is this really: on 100 servers, I have /usr/tmp and ...&lt;BR /&gt;</description>
      <pubDate>Sat, 31 Oct 2009 06:37:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207037#M464273</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-10-31T06:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: grep command help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207038#M464274</link>
      <description>None.</description>
      <pubDate>Mon, 09 Nov 2009 18:41:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-help/m-p/5207038#M464274</guid>
      <dc:creator>rhansen</dc:creator>
      <dc:date>2009-11-09T18:41:01Z</dc:date>
    </item>
  </channel>
</rss>

