<?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: scripting/awk in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938428#M411301</link>
    <description>That's beautiful, even for awk, and it works great.&lt;BR /&gt;&lt;BR /&gt;Just noticed though, not all messages have a Subject tag in a mail file.  That means there's a possibilty that we hit the end of the file, or the next message '^From ' and we need to terminate, subject or not...&lt;BR /&gt;&lt;BR /&gt;How about that one?&lt;BR /&gt;</description>
    <pubDate>Thu, 03 Nov 2005 17:04:50 GMT</pubDate>
    <dc:creator>Fred Martin_1</dc:creator>
    <dc:date>2005-11-03T17:04:50Z</dc:date>
    <item>
      <title>scripting/awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938426#M411299</link>
      <description>I'm searching a file (/var/mail/inbox) for a particular string, the message ID:&lt;BR /&gt;&lt;BR /&gt;awk '/jA3LQqS29893/{print}' /var/mail/fred&lt;BR /&gt;&lt;BR /&gt;What I really want, is to print the first "Subject:" line that follows a match for the message ID.  No way to know how many lines between them.&lt;BR /&gt;&lt;BR /&gt;Any suggestions?  Please no perl etc. lets stick to awk.&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Nov 2005 16:36:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938426#M411299</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2005-11-03T16:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: scripting/awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938427#M411300</link>
      <description>Hi Fred:&lt;BR /&gt;&lt;BR /&gt;How about:&lt;BR /&gt;&lt;BR /&gt;awk '/jA3LQqS29893/ {do {getline} while ($0!~/^Subject/);print}'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;[ perl would look nicer :)) ]&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 03 Nov 2005 16:58:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938427#M411300</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-03T16:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: scripting/awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938428#M411301</link>
      <description>That's beautiful, even for awk, and it works great.&lt;BR /&gt;&lt;BR /&gt;Just noticed though, not all messages have a Subject tag in a mail file.  That means there's a possibilty that we hit the end of the file, or the next message '^From ' and we need to terminate, subject or not...&lt;BR /&gt;&lt;BR /&gt;How about that one?&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Nov 2005 17:04:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938428#M411301</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2005-11-03T17:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: scripting/awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938429#M411302</link>
      <description>I guess the logic would be:&lt;BR /&gt;&lt;BR /&gt;  get a line&lt;BR /&gt;  if end of file&lt;BR /&gt;    or beginning of next message&lt;BR /&gt;  then terminate, else&lt;BR /&gt;  if Subject, print line&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Nov 2005 17:07:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938429#M411302</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2005-11-03T17:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: scripting/awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938430#M411303</link>
      <description>Hi Fred:&lt;BR /&gt;&lt;BR /&gt;OK, then amend this way, perhaps:&lt;BR /&gt;&lt;BR /&gt;# awk '/jA3LQqS29893/ {do {getline} while ($0!~/^Subject/ &amp;amp;&amp;amp; $0!~/^From/);if ($0~/^From/) {exit};print}'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 03 Nov 2005 17:14:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938430#M411303</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-03T17:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: scripting/awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938431#M411304</link>
      <description>IMHO...sed might be better suited for the job-at-hand.</description>
      <pubDate>Thu, 03 Nov 2005 18:16:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938431#M411304</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-11-03T18:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: scripting/awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938432#M411305</link>
      <description>how about something like this:&lt;BR /&gt;&lt;BR /&gt;awk '/jA3LQqS29893/ {flag = 1;}&lt;BR /&gt;/^Subject/ {if (flag == 1) {print;exit;}}&lt;BR /&gt;/^From/ {if (flag == 1) {exit;}'&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Nov 2005 20:31:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938432#M411305</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2005-11-03T20:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: scripting/awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938433#M411306</link>
      <description>James solution is correct.&lt;BR /&gt;You should take time to review awk&lt;BR /&gt;pls refer:&lt;BR /&gt;&lt;A href="http://www.cs.hmc.edu/qref/awk.html" target="_blank"&gt;http://www.cs.hmc.edu/qref/awk.html&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.vectorsite.net/tsawk.html" target="_blank"&gt;http://www.vectorsite.net/tsawk.html&lt;/A&gt;</description>
      <pubDate>Thu, 03 Nov 2005 21:08:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938433#M411306</guid>
      <dc:creator>Nguyen Anh Tien</dc:creator>
      <dc:date>2005-11-03T21:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: scripting/awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938434#M411307</link>
      <description>Many thanks.&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Nov 2005 10:30:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-awk/m-p/4938434#M411307</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2005-11-04T10:30:29Z</dc:date>
    </item>
  </channel>
</rss>

