<?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: Korn Shell Script Help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079198#M440116</link>
    <description>awk 'NR &amp;gt; 5 {print $1 "FROZEN}' myfile.txt&lt;BR /&gt;</description>
    <pubDate>Mon, 12 Nov 2007 14:35:47 GMT</pubDate>
    <dc:creator>Tim Nelson</dc:creator>
    <dc:date>2007-11-12T14:35:47Z</dc:date>
    <item>
      <title>Korn Shell Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079197#M440115</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Kindly assist me.&lt;BR /&gt;&lt;BR /&gt;I have output as per attached.&lt;BR /&gt;&lt;BR /&gt;I need to extract FROZEN ID.&lt;BR /&gt;My output format should be as follow :&lt;BR /&gt;&lt;BR /&gt;ID     Status&lt;BR /&gt;006707 FROZEN&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;-Kamarul&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Nov 2007 14:24:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079197#M440115</guid>
      <dc:creator>KAMARULZAMAN HJ ALI</dc:creator>
      <dc:date>2007-11-12T14:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Korn Shell Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079198#M440116</link>
      <description>awk 'NR &amp;gt; 5 {print $1 "FROZEN}' myfile.txt&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Nov 2007 14:35:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079198#M440116</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2007-11-12T14:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Korn Shell Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079199#M440117</link>
      <description>sorry, forgot a quote&lt;BR /&gt;awk 'NR &amp;gt; 5 {print $1 "FROZEN"}' myfile.txt</description>
      <pubDate>Mon, 12 Nov 2007 14:36:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079199#M440117</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2007-11-12T14:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Korn Shell Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079200#M440118</link>
      <description>Sounds like simple text processing possibly best done in AWK or PERL, not in a shell loop.&lt;BR /&gt;&lt;BR /&gt;Here is a possible solution:&lt;BR /&gt;&lt;BR /&gt;$ cat x.pl&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my $id;&lt;BR /&gt;my $header=0;&lt;BR /&gt;#&lt;BR /&gt;# Read in all data lines from STDIN or first file mentioned.&lt;BR /&gt;#&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;  $id = $1 if /^(\d+)\s/; #Looks like an id? Remember it.&lt;BR /&gt;  if (/FROZEN\s+$/) { # Line ends in 'FROZEN'?&lt;BR /&gt;    print "  ID   Status\n" unless $header++;&lt;BR /&gt;    print "$id FROZEN\n";&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;$ ./x.pl x&lt;BR /&gt;  ID   Status&lt;BR /&gt;006707 FROZEN&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Nov 2007 14:45:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079200#M440118</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-11-12T14:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Korn Shell Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079201#M440119</link>
      <description># awk 'BEGIN{print "Id\tStatus"} {if($0~"FROZEN") print l"\t"$NF;l=$1}' file</description>
      <pubDate>Mon, 12 Nov 2007 14:47:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079201#M440119</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-11-12T14:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Korn Shell Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079202#M440120</link>
      <description>&amp;gt;Tim: awk 'NR &amp;gt; 5 {print $1 "FROZEN"}'&lt;BR /&gt;&lt;BR /&gt;The problem here is that the ID is on the first of a two line pair.  Checking NR &amp;gt; 5 also fails because of the titles and the line with "FULL" and the first of the pair.&lt;BR /&gt;&lt;BR /&gt;Sandman's solves those issues.</description>
      <pubDate>Mon, 12 Nov 2007 23:14:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079202#M440120</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-11-12T23:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Korn Shell Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079203#M440121</link>
      <description>&lt;!--!*#--&gt;Thanks All,&lt;BR /&gt;&lt;BR /&gt;Tim, I got the following output that not as expected.&lt;BR /&gt;cel8484_MHS:/home/sup01/FREEZE# awk 'NR &amp;gt; 5 {print $1 "FROZEN"}' media_freeze_v2.dat&lt;BR /&gt;005837FROZEN&lt;BR /&gt;17FROZEN&lt;BR /&gt;FROZEN&lt;BR /&gt;005842FROZEN&lt;BR /&gt;19FROZEN&lt;BR /&gt;FROZEN&lt;BR /&gt;006703FROZEN&lt;BR /&gt;15FROZEN&lt;BR /&gt;FROZEN&lt;BR /&gt;006704FROZEN&lt;BR /&gt;0FROZEN&lt;BR /&gt;FROZEN&lt;BR /&gt;006707FROZEN&lt;BR /&gt;6FROZEN&lt;BR /&gt;FROZEN&lt;BR /&gt;006710FROZEN&lt;BR /&gt;7FROZEN&lt;BR /&gt;&lt;BR /&gt;Hein, great!! I got the output as I'm expected.&lt;BR /&gt;Thanks although I'm not familiar with perl but got the solution.&lt;BR /&gt;&lt;BR /&gt;Sanman, also great. I got it &amp;amp; thanks.&lt;BR /&gt;&lt;BR /&gt;Dennis, thanks for your reply.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Nov 2007 00:34:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079203#M440121</guid>
      <dc:creator>KAMARULZAMAN HJ ALI</dc:creator>
      <dc:date>2007-11-13T00:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Korn Shell Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079204#M440122</link>
      <description>You haven't assigned any points here.  If some of the answers were useful, thank us by points.  That way everyone else knows which are useful.&lt;BR /&gt;See the following:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt;&lt;BR /&gt;You can reopen by:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#41" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#41&lt;/A&gt;</description>
      <pubDate>Tue, 13 Nov 2007 03:28:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell-script-help/m-p/5079204#M440122</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-11-13T03:28:58Z</dc:date>
    </item>
  </channel>
</rss>

