<?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: newbie needs a script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865472#M97133</link>
    <description>hi,&lt;BR /&gt;&lt;BR /&gt;You could also try a script like this one :&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;TASK=$1&lt;BR /&gt;shift&lt;BR /&gt;OUTFILE=$TASK.out&lt;BR /&gt;awk '&lt;BR /&gt;/=generation '$TASK'=/,/=end of generation '$TASK'=/&lt;BR /&gt;/=deletion '$TASK'=/,/=end of deletion '$TASK'=/' $* &amp;gt; $OUTFILE&lt;BR /&gt;&lt;BR /&gt;You could of course use a more complex pattern to delimit begin and end of blocks ... It's really simple because awk use its default action (printing line) for every linesbetween patterns.&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
    <pubDate>Wed, 18 Dec 2002 13:02:48 GMT</pubDate>
    <dc:creator>Jean-Louis Phelix</dc:creator>
    <dc:date>2002-12-18T13:02:48Z</dc:date>
    <item>
      <title>newbie needs a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865464#M97125</link>
      <description>hi guys, pardon me but im still a newbie. ill appreciate any help for this:&lt;BR /&gt;&lt;BR /&gt;i have five log-files, say generation, deletion, filtering,sorting and summarizing. each of this logs contains 3 entries say for generation-log (generation a, b, c...), deletion (deletion a, b, c...) which are variable in length. i wana make a script that could collect the details from each log and integrated the details into file a, file b and file c. so the output files will then be, File a - contains generation a, deletion a, filtering a, sorting a and summarizing a logs.</description>
      <pubDate>Tue, 17 Dec 2002 08:52:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865464#M97125</guid>
      <dc:creator>hien</dc:creator>
      <dc:date>2002-12-17T08:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: newbie needs a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865465#M97126</link>
      <description>grep a generation &amp;gt; a.log&lt;BR /&gt;grep a deletion &amp;gt;&amp;gt; a.log&lt;BR /&gt;grep a filtering &amp;gt;&amp;gt; a.log&lt;BR /&gt;grep a sorting &amp;gt;&amp;gt; a.log&lt;BR /&gt;grep a summarizing &amp;gt;&amp;gt; a.log&lt;BR /&gt;&lt;BR /&gt;repeat for b, c, etc.&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 17 Dec 2002 12:29:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865465#M97126</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2002-12-17T12:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: newbie needs a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865466#M97127</link>
      <description>pete, com'on, you can do better than that! :)&lt;BR /&gt;&lt;BR /&gt;grep -e a -e b -e c generation deletion filtering sorting ... &amp;gt; a.log</description>
      <pubDate>Tue, 17 Dec 2002 12:48:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865466#M97127</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-12-17T12:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: newbie needs a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865467#M97128</link>
      <description>Good point, Merijn.  It's early yet - only one coffee so far.  &lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 17 Dec 2002 12:51:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865467#M97128</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2002-12-17T12:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: newbie needs a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865468#M97129</link>
      <description>thanks guys but its not only one line..the format for the 5 logs are below, say generation log.&lt;BR /&gt;&lt;BR /&gt;=========a==============&lt;BR /&gt;fasdfasdf asdfasdf&lt;BR /&gt;asf   adf&lt;BR /&gt;asf&lt;BR /&gt;asdf&lt;BR /&gt;asdf&lt;BR /&gt;asfasdfasdf&lt;BR /&gt;asfasdfasdf&lt;BR /&gt;==&amp;gt;end of a&lt;BR /&gt;=========b==============&lt;BR /&gt;fasdfsadf&lt;BR /&gt;asf&lt;BR /&gt;asdf&lt;BR /&gt;asfsd&lt;BR /&gt;af&lt;BR /&gt;==&amp;gt;end of b&lt;BR /&gt;=========c==============&lt;BR /&gt;asdf&lt;BR /&gt;asdf&lt;BR /&gt;asfs&lt;BR /&gt;adf&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Dec 2002 00:38:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865468#M97129</guid>
      <dc:creator>hien</dc:creator>
      <dc:date>2002-12-18T00:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: newbie needs a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865469#M97130</link>
      <description>nibble,&lt;BR /&gt;&lt;BR /&gt;What are you identifying as a "LOG" ?????????&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Wed, 18 Dec 2002 02:14:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865469#M97130</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-12-18T02:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: newbie needs a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865470#M97131</link>
      <description>hi harry,&lt;BR /&gt;&lt;BR /&gt;actually, its not a log. its an output of a program which we have to filter manually then integrate it to files as reports.&lt;BR /&gt;&lt;BR /&gt;the raw output is usually combination of alpha numeric, with some details that we don't need. usually separted as:&lt;BR /&gt;&lt;BR /&gt;file output 1&lt;BR /&gt;&lt;BR /&gt;======generation a====&lt;BR /&gt;asf13asdf&lt;BR /&gt;asdf134&lt;BR /&gt;asdf12323...&lt;BR /&gt;=====end of generation a==&lt;BR /&gt;&lt;BR /&gt;==generation b====&lt;BR /&gt;afasdf123123&lt;BR /&gt;asdfsadf13&lt;BR /&gt;asdfasdf...&lt;BR /&gt;==end of generation b===&lt;BR /&gt;&lt;BR /&gt;the other outputs have more orless the same format. &lt;BR /&gt;with filtering/removing unwanted details, i have already created a script which mostly uses grep. i have a problem in intergarting them to final data. say, file A should contain output1 A, output2 A, output 3 A...</description>
      <pubDate>Wed, 18 Dec 2002 02:45:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865470#M97131</guid>
      <dc:creator>hien</dc:creator>
      <dc:date>2002-12-18T02:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: newbie needs a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865471#M97132</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if the files all have the same size, you could use a script like this one (untested):&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;&amp;gt;result.txt&lt;BR /&gt;let nl=`wc -l file1`&lt;BR /&gt;let i=1&lt;BR /&gt;while [ $i -le $nl ]&lt;BR /&gt;do&lt;BR /&gt;a= `head -n $i file1|tail -n 1`&lt;BR /&gt;b= `head -n $i file2|tail -n 1`&lt;BR /&gt;c= `head -n $i file3|tail -n 1`&lt;BR /&gt;&lt;BR /&gt;echo $a $b $c &amp;gt;&amp;gt; result.txt&lt;BR /&gt;let i=$i+1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;As I don't have access to my platform currently, I couldn't test this cript, but it should not be far from the wished result.&lt;BR /&gt;Of course, the head|tail part of the script means that you're reading nl*(nl+1)*2 lines, but that's, after all, still a polynomial algorithm ;-)&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;FiX&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Dec 2002 12:35:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865471#M97132</guid>
      <dc:creator>F. X. de Montgolfier</dc:creator>
      <dc:date>2002-12-18T12:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: newbie needs a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865472#M97133</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;You could also try a script like this one :&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;TASK=$1&lt;BR /&gt;shift&lt;BR /&gt;OUTFILE=$TASK.out&lt;BR /&gt;awk '&lt;BR /&gt;/=generation '$TASK'=/,/=end of generation '$TASK'=/&lt;BR /&gt;/=deletion '$TASK'=/,/=end of deletion '$TASK'=/' $* &amp;gt; $OUTFILE&lt;BR /&gt;&lt;BR /&gt;You could of course use a more complex pattern to delimit begin and end of blocks ... It's really simple because awk use its default action (printing line) for every linesbetween patterns.&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Wed, 18 Dec 2002 13:02:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865472#M97133</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2002-12-18T13:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: newbie needs a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865473#M97134</link>
      <description>I forgot to write that you should use this script with the task as first parameter followed by the output files list ...&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Wed, 18 Dec 2002 13:29:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-needs-a-script/m-p/2865473#M97134</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2002-12-18T13:29:57Z</dc:date>
    </item>
  </channel>
</rss>

