<?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: Script &amp;quot;Pattern matching help&amp;quot; in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quot-pattern-matching-help-quot/m-p/3433140#M707440</link>
    <description>perl is also an option&lt;BR /&gt;&lt;BR /&gt;perl -ane 'if (m/Hostname/) {$hst="@F"}; if (m/Comments: Development/) {print "$hst \n"}' file&lt;BR /&gt;&lt;BR /&gt;Just another way of doing the same in a funkier/newer language.  &lt;BR /&gt;&lt;BR /&gt;Redards&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 30 Nov 2004 15:57:19 GMT</pubDate>
    <dc:creator>Tim D Fulford</dc:creator>
    <dc:date>2004-11-30T15:57:19Z</dc:date>
    <item>
      <title>Script "Pattern matching help"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quot-pattern-matching-help-quot/m-p/3433136#M707436</link>
      <description>I have a file having following contents: &lt;BR /&gt;&lt;BR /&gt;Hostname:&lt;BR /&gt;Comments: &lt;DEVELOPMENT&gt; &lt;BR /&gt;&lt;BR /&gt;This may contain several lines arranged in fashion as given above. &lt;BR /&gt;&lt;BR /&gt;I want to grab those hosts having development in comment field. &lt;BR /&gt;&lt;BR /&gt;If I try doing it using egrep, Hostname line is anyways getting included even if it is not development box. What can be the turn around. I appreciate all your help. &lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Prashant&lt;/DEVELOPMENT&gt;</description>
      <pubDate>Tue, 30 Nov 2004 10:52:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quot-pattern-matching-help-quot/m-p/3433136#M707436</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2004-11-30T10:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script "Pattern matching help"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quot-pattern-matching-help-quot/m-p/3433137#M707437</link>
      <description>Prashant,&lt;BR /&gt;&lt;BR /&gt;You could adapt this hint from "Handy One Liners for Sed" (attached):&lt;BR /&gt;&lt;BR /&gt;# print 1 line of context before and after regexp, with line number&lt;BR /&gt; # indicating where the regexp occurred (similar to "grep -A1 -B1")&lt;BR /&gt; sed -n -e '/regexp/{=;x;1!p;g;$!N;p;D;}' -e h&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 30 Nov 2004 11:05:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quot-pattern-matching-help-quot/m-p/3433137#M707437</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-11-30T11:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Script "Pattern matching help"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quot-pattern-matching-help-quot/m-p/3433138#M707438</link>
      <description>How about "awk"-&lt;BR /&gt; &lt;BR /&gt;awk '/^Hostname/{h=$0};/^Comments: Devel/{print h}' yourfile&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 30 Nov 2004 11:09:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quot-pattern-matching-help-quot/m-p/3433138#M707438</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-11-30T11:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Script "Pattern matching help"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quot-pattern-matching-help-quot/m-p/3433139#M707439</link>
      <description>That was great. I have did it using sed. Just nice. &lt;BR /&gt;&lt;BR /&gt;Thanks and regards&lt;BR /&gt;Prashant</description>
      <pubDate>Tue, 30 Nov 2004 15:15:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quot-pattern-matching-help-quot/m-p/3433139#M707439</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2004-11-30T15:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script "Pattern matching help"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quot-pattern-matching-help-quot/m-p/3433140#M707440</link>
      <description>perl is also an option&lt;BR /&gt;&lt;BR /&gt;perl -ane 'if (m/Hostname/) {$hst="@F"}; if (m/Comments: Development/) {print "$hst \n"}' file&lt;BR /&gt;&lt;BR /&gt;Just another way of doing the same in a funkier/newer language.  &lt;BR /&gt;&lt;BR /&gt;Redards&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Nov 2004 15:57:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quot-pattern-matching-help-quot/m-p/3433140#M707440</guid>
      <dc:creator>Tim D Fulford</dc:creator>
      <dc:date>2004-11-30T15:57:19Z</dc:date>
    </item>
  </channel>
</rss>

