<?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 script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573597#M857686</link>
    <description>hai;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;May be  a simple question &lt;BR /&gt;&lt;BR /&gt;I want a help to write one script.My requirement is  search for a string and grep the next line to the line having the string(not the same line).&lt;BR /&gt;&lt;BR /&gt;Any idea&lt;BR /&gt;&lt;BR /&gt;thanks in advance&lt;BR /&gt;G.kumar</description>
    <pubDate>Fri, 31 Aug 2001 15:13:25 GMT</pubDate>
    <dc:creator>G.Kumar</dc:creator>
    <dc:date>2001-08-31T15:13:25Z</dc:date>
    <item>
      <title>script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573597#M857686</link>
      <description>hai;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;May be  a simple question &lt;BR /&gt;&lt;BR /&gt;I want a help to write one script.My requirement is  search for a string and grep the next line to the line having the string(not the same line).&lt;BR /&gt;&lt;BR /&gt;Any idea&lt;BR /&gt;&lt;BR /&gt;thanks in advance&lt;BR /&gt;G.kumar</description>
      <pubDate>Fri, 31 Aug 2001 15:13:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573597#M857686</guid>
      <dc:creator>G.Kumar</dc:creator>
      <dc:date>2001-08-31T15:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573598#M857687</link>
      <description>Hi&lt;BR /&gt;In perl:&lt;BR /&gt;&lt;BR /&gt;#!/usr/local/bin/perl&lt;BR /&gt;&lt;BR /&gt;open(FILE,"filename") || die "can't open file\n";&lt;BR /&gt;$string_match=0;&lt;BR /&gt;&lt;BR /&gt;while &lt;FILE&gt;&lt;BR /&gt;{&lt;BR /&gt;  if (string_match == 1){&lt;BR /&gt;    print "$_  is your next line";&lt;BR /&gt;  }&lt;BR /&gt;  if (/string/) {&lt;BR /&gt;   next;&lt;BR /&gt;   $string_match=1;&lt;BR /&gt;  }&lt;BR /&gt;  else{&lt;BR /&gt;   next;&lt;BR /&gt;  }&lt;BR /&gt;}#end of while&lt;BR /&gt;&lt;BR /&gt;Sachin&lt;BR /&gt;&lt;/FILE&gt;</description>
      <pubDate>Fri, 31 Aug 2001 15:25:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573598#M857687</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2001-08-31T15:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573599#M857688</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Try something like this:&lt;BR /&gt;&lt;BR /&gt;# awk '/token1/ {getline;if (/token2/) {print $0}}' myfile&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 31 Aug 2001 15:29:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573599#M857688</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-08-31T15:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573600#M857689</link>
      <description>sed -n '/your_string/,$p' your_file |sed -n '2p'&lt;BR /&gt;&lt;BR /&gt;This should work. &lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 31 Aug 2001 15:32:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573600#M857689</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-08-31T15:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573601#M857690</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;If I understand you correctly then this should do it:-&lt;BR /&gt;&lt;BR /&gt;Cat &lt;FILENAME&gt; | grep &lt;WHATEVER&gt; | grep &lt;RESULTS&gt; (and so on)&lt;BR /&gt;&lt;BR /&gt;If the data is in a column format :-&lt;BR /&gt;&lt;BR /&gt;dataA   dataB   DataC   DataD &lt;BR /&gt;&lt;BR /&gt;and you wish to just pick out the "dataC" column then&lt;BR /&gt;&lt;BR /&gt;Cat &lt;FILENAME&gt; | grep &lt;WHATEVER&gt; | awk '{print $3}'&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Paula&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/WHATEVER&gt;&lt;/FILENAME&gt;&lt;/RESULTS&gt;&lt;/WHATEVER&gt;&lt;/FILENAME&gt;</description>
      <pubDate>Fri, 31 Aug 2001 15:40:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573601#M857690</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2001-08-31T15:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573602#M857691</link>
      <description>Hi.&lt;BR /&gt;Let me make sure I understand your question.&lt;BR /&gt;Do you want to search to see what files contain a given string, then read the line after the line that contains this string, grepping for a second string?&lt;BR /&gt;&lt;BR /&gt;If not, could you please clarify.&lt;BR /&gt;It also may become more complicated if you are recursively searching a directory or file system, since you would need to issue a find command to generate a list of files, then use loop to do a grep against each item in the list.&lt;BR /&gt;</description>
      <pubDate>Fri, 31 Aug 2001 15:45:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573602#M857691</guid>
      <dc:creator>Jay Newman</dc:creator>
      <dc:date>2001-08-31T15:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573603#M857692</link>
      <description>hi&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply.&lt;BR /&gt;"sed" works.&lt;BR /&gt;&lt;BR /&gt;one more question...&lt;BR /&gt;&lt;BR /&gt;If my string is variable can i use sed ?&lt;BR /&gt;&lt;BR /&gt;thanks in advance&lt;BR /&gt;</description>
      <pubDate>Fri, 31 Aug 2001 17:11:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573603#M857692</guid>
      <dc:creator>G.Kumar</dc:creator>
      <dc:date>2001-08-31T17:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573604#M857693</link>
      <description>Hi Kumar,&lt;BR /&gt;&lt;BR /&gt;Yes you can...&lt;BR /&gt;&lt;BR /&gt;sed -n '/'$YOUR_VARIABLE'/,$p' your_file |sed -n '2p'&lt;BR /&gt;&lt;BR /&gt;Please note those single quotes on $YOUR_VARIABLE.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 31 Aug 2001 17:18:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2573604#M857693</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-08-31T17:18:08Z</dc:date>
    </item>
  </channel>
</rss>

