<?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 ksh script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033407#M718921</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Does anyone know how to match a pattern within a text-file for specific linenumbers ?&lt;BR /&gt;&lt;BR /&gt;As an example :&lt;BR /&gt;&lt;BR /&gt;/tmp/text :&lt;BR /&gt;bla die bla&lt;BR /&gt;line 2 is filled&lt;BR /&gt;line 3 is filled&lt;BR /&gt;555&lt;BR /&gt;line 4 is filled&lt;BR /&gt;&lt;BR /&gt;Now I want to catch the all numbers from lines 3 and 4.&lt;BR /&gt;&lt;BR /&gt;so : var=`cat /tmp/text | ?? parse only lines 3 and 4?? | ?? grep [0-9] ??`&lt;BR /&gt;&lt;BR /&gt;Now I know this looks very silly, but I have Perl in my mind and cannot translate it into ksh. So two questions, how do I only parse specific lines, how do I filter out only numbers for those 2 lines.&lt;BR /&gt;&lt;BR /&gt;Any help will be much apreciated.&lt;BR /&gt;&lt;BR /&gt;Regs David</description>
    <pubDate>Fri, 25 Jul 2003 10:50:04 GMT</pubDate>
    <dc:creator>David_246</dc:creator>
    <dc:date>2003-07-25T10:50:04Z</dc:date>
    <item>
      <title>ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033407#M718921</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Does anyone know how to match a pattern within a text-file for specific linenumbers ?&lt;BR /&gt;&lt;BR /&gt;As an example :&lt;BR /&gt;&lt;BR /&gt;/tmp/text :&lt;BR /&gt;bla die bla&lt;BR /&gt;line 2 is filled&lt;BR /&gt;line 3 is filled&lt;BR /&gt;555&lt;BR /&gt;line 4 is filled&lt;BR /&gt;&lt;BR /&gt;Now I want to catch the all numbers from lines 3 and 4.&lt;BR /&gt;&lt;BR /&gt;so : var=`cat /tmp/text | ?? parse only lines 3 and 4?? | ?? grep [0-9] ??`&lt;BR /&gt;&lt;BR /&gt;Now I know this looks very silly, but I have Perl in my mind and cannot translate it into ksh. So two questions, how do I only parse specific lines, how do I filter out only numbers for those 2 lines.&lt;BR /&gt;&lt;BR /&gt;Any help will be much apreciated.&lt;BR /&gt;&lt;BR /&gt;Regs David</description>
      <pubDate>Fri, 25 Jul 2003 10:50:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033407#M718921</guid>
      <dc:creator>David_246</dc:creator>
      <dc:date>2003-07-25T10:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033408#M718922</link>
      <description>Simply do grep -n -e "expression"&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Bernhard</description>
      <pubDate>Fri, 25 Jul 2003 10:56:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033408#M718922</guid>
      <dc:creator>Bernhard Mueller</dc:creator>
      <dc:date>2003-07-25T10:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033409#M718923</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;cat file | awk ' /line 3/,/line4/ '&lt;BR /&gt;&lt;BR /&gt;Quick and dirty ?&lt;BR /&gt;&lt;BR /&gt;  Massimo</description>
      <pubDate>Fri, 25 Jul 2003 11:01:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033409#M718923</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-07-25T11:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033410#M718924</link>
      <description>-n option doesn't work with linenumbers, it only shows the the linennumbers where it grep'ed the -e match from.&lt;BR /&gt;&lt;BR /&gt;The awk option only works if you know what is on line 3 and 4, as this is your goal it doesn't help.&lt;BR /&gt;&lt;BR /&gt;Thanks for your try.&lt;BR /&gt;&lt;BR /&gt;Regs David</description>
      <pubDate>Fri, 25 Jul 2003 11:05:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033410#M718924</guid>
      <dc:creator>David_246</dc:creator>
      <dc:date>2003-07-25T11:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033411#M718925</link>
      <description>Hi David:&lt;BR /&gt;&lt;BR /&gt;# awk 'NR&amp;gt;=3 &amp;amp;&amp;amp; NR&amp;lt;=4 &amp;amp;&amp;amp; /[[0-9]]*/ {print}' filename&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 25 Jul 2003 11:06:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033411#M718925</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-07-25T11:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033412#M718926</link>
      <description>More closer to what you demand might be:&lt;BR /&gt;&lt;BR /&gt;grep -n -e "[0-9]" /tmp/text | grep -E "^3|^4"&lt;BR /&gt;&lt;BR /&gt;man grep gives you all the info you need&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Bernhard&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Jul 2003 11:07:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033412#M718926</guid>
      <dc:creator>Bernhard Mueller</dc:creator>
      <dc:date>2003-07-25T11:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033413#M718927</link>
      <description>Good work James !! &lt;BR /&gt;&lt;BR /&gt;I knew I could count on you :)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regs David</description>
      <pubDate>Fri, 25 Jul 2003 11:10:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033413#M718927</guid>
      <dc:creator>David_246</dc:creator>
      <dc:date>2003-07-25T11:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033414#M718928</link>
      <description>cat file | head -n 5 | tail -n 1&lt;BR /&gt;&lt;BR /&gt;  Second try</description>
      <pubDate>Fri, 25 Jul 2003 11:11:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033414#M718928</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-07-25T11:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033415#M718929</link>
      <description>Hi David,&lt;BR /&gt;&lt;BR /&gt;Sorry but i don't understand very well your problem.&lt;BR /&gt;Why line4 is 5th line in the file?&lt;BR /&gt;The 555 number is the line 4 or is part of the line 3?&lt;BR /&gt;&lt;BR /&gt;If i parse only line 3 and line 4 that you say, i have no matter to catch the 555 number.&lt;BR /&gt;&lt;BR /&gt;Please tell me more accuratelly that you want, perhaps i can help you.&lt;BR /&gt;&lt;BR /&gt;Frank.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Jul 2003 11:18:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033415#M718929</guid>
      <dc:creator>Francisco J. Soler</dc:creator>
      <dc:date>2003-07-25T11:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033416#M718930</link>
      <description>David,&lt;BR /&gt;if you only want to pick out the numbers from lines 3 &amp;amp; 4, try this (I'm assuming that all the numbers are integers):&lt;BR /&gt;&lt;BR /&gt;cat text.awk&lt;BR /&gt;NR == 3 || NR == 4 {&lt;BR /&gt;for (i=1; i&amp;lt;=NF; i++) {&lt;BR /&gt;    if (int($i) == $i) {&lt;BR /&gt;        printf("%d ", $i)&lt;BR /&gt;    }&lt;BR /&gt;    }&lt;BR /&gt;printf("\n")&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;cat /tmp/text | awk -f text.awk&lt;BR /&gt;3&lt;BR /&gt;555&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Michael.</description>
      <pubDate>Fri, 25 Jul 2003 11:35:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-script/m-p/3033416#M718930</guid>
      <dc:creator>Michael Kelly_5</dc:creator>
      <dc:date>2003-07-25T11:35:31Z</dc:date>
    </item>
  </channel>
</rss>

