<?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 AWK in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-and-awk/m-p/2786176#M78486</link>
    <description>To match the pattern, use "grep". To match every BUT the pattern, use "grep -v". The "-v" inverts the match.&lt;BR /&gt;&lt;BR /&gt;grep wmtpe filename &amp;gt; file_A&lt;BR /&gt;grep -v wmtpe filename &amp;gt; file_B&lt;BR /&gt;&lt;BR /&gt;Tom</description>
    <pubDate>Wed, 14 Aug 2002 15:14:33 GMT</pubDate>
    <dc:creator>Tom Maloy</dc:creator>
    <dc:date>2002-08-14T15:14:33Z</dc:date>
    <item>
      <title>grep and AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-and-awk/m-p/2786175#M78485</link>
      <description>HI &lt;BR /&gt;I have the file attached in this message. I would like to read the file contents. I would like to extract the entire record of the disk-names ($1 ) having the pattern wmtpe, as of:&lt;BR /&gt;/fs35/wmtpe211  &lt;BR /&gt;/fs35/wmtpe212 &lt;BR /&gt;/fs35/wmtpe213 &lt;BR /&gt;&lt;BR /&gt;from the file attached, and place them into another file.&lt;BR /&gt;I would like to have the following types of record in file_A with pattern wmtpe:&lt;BR /&gt;/fs35/wmtpe212 wmt 16.8516 2.6224 &lt;BR /&gt;/fs35/wmtpe213 wmt 13.6721 6.5676&lt;BR /&gt;/fs35/wmtpe214 wmt 16.8516 11.4333&lt;BR /&gt;&lt;BR /&gt;and the other disk-names without the pattern wmtpe to be in file_B:&lt;BR /&gt;/fs36/nwdv.apv.bctl wmt 17.890 6.7809&lt;BR /&gt;/fs36/nwdv.shark.bctl wmt 18.978 5.4678&lt;BR /&gt;&lt;BR /&gt;I tried the following:&lt;BR /&gt;for i in `cat fileName`&lt;BR /&gt;do   &lt;BR /&gt;  grep -v wmtpe &amp;gt;&amp;gt; temp_file&lt;BR /&gt;done   &lt;BR /&gt;&lt;BR /&gt;I'm not sure how I could extract the disk names with pattern wmtpe with its entire record, and place them into a file_A, and have the remaining disk-name entries, with its entire records into file_B. &lt;BR /&gt;&lt;BR /&gt;Could someone please help me out?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Aug 2002 15:02:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-and-awk/m-p/2786175#M78485</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-08-14T15:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: grep and AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-and-awk/m-p/2786176#M78486</link>
      <description>To match the pattern, use "grep". To match every BUT the pattern, use "grep -v". The "-v" inverts the match.&lt;BR /&gt;&lt;BR /&gt;grep wmtpe filename &amp;gt; file_A&lt;BR /&gt;grep -v wmtpe filename &amp;gt; file_B&lt;BR /&gt;&lt;BR /&gt;Tom</description>
      <pubDate>Wed, 14 Aug 2002 15:14:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-and-awk/m-p/2786176#M78486</guid>
      <dc:creator>Tom Maloy</dc:creator>
      <dc:date>2002-08-14T15:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: grep and AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-and-awk/m-p/2786177#M78487</link>
      <description>&lt;BR /&gt;grep "wmtpe" this_file &amp;gt;&amp;gt; file_A&lt;BR /&gt;&lt;BR /&gt;grep -v "wmtpe" this_file &amp;gt;&amp;gt; file_b&lt;BR /&gt;&lt;BR /&gt;Did I misunderstand your message?.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Wed, 14 Aug 2002 15:19:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-and-awk/m-p/2786177#M78487</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2002-08-14T15:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: grep and AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-and-awk/m-p/2786178#M78488</link>
      <description>You just have to be more specific with your grep statement. For example ..&lt;BR /&gt;&lt;BR /&gt;$ grep \^/fs[1-9]*[0-9]/wmtpe fileName &amp;gt; file_A&lt;BR /&gt;&lt;BR /&gt;..will match for all lines that begins with "/fs&lt;NUMBER_BETWEEN_1-&gt;9&amp;gt;&lt;NUMBER_BETWEEN_0-9&gt;/wmtpe".&lt;BR /&gt;&lt;BR /&gt;$ grep \^/fs[1-9]*[0-9]/nwdv fileName &amp;gt; file_B&lt;BR /&gt;&lt;BR /&gt;..same explaination here except for "nwdv" in place of "wmtpe".&lt;/NUMBER_BETWEEN_0-9&gt;&lt;/NUMBER_BETWEEN_1-&gt;</description>
      <pubDate>Wed, 14 Aug 2002 15:26:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-and-awk/m-p/2786178#M78488</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-08-14T15:26:09Z</dc:date>
    </item>
  </channel>
</rss>

