<?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: Problem on scripting. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576124#M858366</link>
    <description>Thanks for your quick response, BPK.&lt;BR /&gt;Sorry that I did not state myself clear. Actually I want to make the menu NOT showing on the screen but only show the "data". I had tried your method but it still shows the menu on the screen even I tried to add "grep -v MENU". Do you have any other methods that can tell me??&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
    <pubDate>Thu, 06 Sep 2001 07:39:11 GMT</pubDate>
    <dc:creator>Kenny Chau</dc:creator>
    <dc:date>2001-09-06T07:39:11Z</dc:date>
    <item>
      <title>Problem on scripting.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576120#M858362</link>
      <description>I am writing a script to capture something from a DB with the DB command "promon" which will call a menu. In fact, I can capture the data that I want but it also displays the menu together with the data. So I want to know how to make the menu disappear but only appear the output.&lt;BR /&gt;My script is something like below:&lt;BR /&gt;&lt;BR /&gt;FunctionA ()&lt;BR /&gt;{&lt;BR /&gt;{&lt;BR /&gt;promon DB1 &amp;lt;&amp;lt;-EOF | grep "data"&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;q&lt;BR /&gt;q&lt;BR /&gt;EOF&lt;BR /&gt;} &amp;gt; file1  &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;And the output is something like this:&lt;BR /&gt;&lt;BR /&gt;Menu:&lt;BR /&gt;1.  xxxx&lt;BR /&gt;2.  xxxx&lt;BR /&gt;3.  xxxx&lt;BR /&gt;&lt;BR /&gt;q.  exit&lt;BR /&gt;&lt;BR /&gt;Choice:&lt;BR /&gt;&lt;INFORMATION that="" i="" wanted="" appear="" here=""&gt;&lt;BR /&gt;&lt;BR /&gt;I had tried to use "1&amp;gt; /dev/null" in some places but failed to get the data.&lt;BR /&gt;&lt;BR /&gt;Hope you guys can help me.&lt;BR /&gt;&lt;BR /&gt;Thanks very much.&lt;/INFORMATION&gt;</description>
      <pubDate>Thu, 06 Sep 2001 07:09:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576120#M858362</guid>
      <dc:creator>Kenny Chau</dc:creator>
      <dc:date>2001-09-06T07:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem on scripting.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576121#M858363</link>
      <description>Hi&lt;BR /&gt;  Why don't you grep out the MENU from the file after it has got generated, like&lt;BR /&gt;&lt;BR /&gt;grep -v "MENU" file.lst &amp;gt; file.lst.tmp&lt;BR /&gt;mv file.lst.tmp file.lst&lt;BR /&gt;&lt;BR /&gt;...BPK...</description>
      <pubDate>Thu, 06 Sep 2001 07:16:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576121#M858363</guid>
      <dc:creator>Praveen Bezawada</dc:creator>
      <dc:date>2001-09-06T07:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem on scripting.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576122#M858364</link>
      <description>Thanks for your response, BPK.&lt;BR /&gt;I had tried to generate the whole things (menu and data) to a file and then grep the necessary data but still failed.&lt;BR /&gt;&lt;BR /&gt;I had modified the script to:&lt;BR /&gt;&lt;BR /&gt;FunctionA ()&lt;BR /&gt;{&lt;BR /&gt;{&lt;BR /&gt;promon DB1 &amp;lt;&amp;lt;-EOF&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;q&lt;BR /&gt;q&lt;BR /&gt;EOF&lt;BR /&gt;} &amp;gt; file1&lt;BR /&gt;}&lt;BR /&gt;grep "data" file1&lt;BR /&gt;&lt;BR /&gt;However, it still shows the menu in the screen together with the "data".&lt;BR /&gt;&lt;BR /&gt;Actually I want to make the menu not showing in the screen and only shows the "data".&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Sep 2001 07:28:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576122#M858364</guid>
      <dc:creator>Kenny Chau</dc:creator>
      <dc:date>2001-09-06T07:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem on scripting.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576123#M858365</link>
      <description>HI&lt;BR /&gt;  Use grep -v "MENU" to remove the menu., redirect in into a file...</description>
      <pubDate>Thu, 06 Sep 2001 07:33:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576123#M858365</guid>
      <dc:creator>Praveen Bezawada</dc:creator>
      <dc:date>2001-09-06T07:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem on scripting.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576124#M858366</link>
      <description>Thanks for your quick response, BPK.&lt;BR /&gt;Sorry that I did not state myself clear. Actually I want to make the menu NOT showing on the screen but only show the "data". I had tried your method but it still shows the menu on the screen even I tried to add "grep -v MENU". Do you have any other methods that can tell me??&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 06 Sep 2001 07:39:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576124#M858366</guid>
      <dc:creator>Kenny Chau</dc:creator>
      <dc:date>2001-09-06T07:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem on scripting.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576125#M858367</link>
      <description>Hi Kenny,&lt;BR /&gt;&lt;BR /&gt;it is possible, that the promon program outputs the menu to the STDERR file descriptor (2) and not to the STDOUT (1). To discard the output on STDERR redirect in this way:&lt;BR /&gt;&lt;BR /&gt;   ...&lt;BR /&gt;   } 2&amp;gt;/dev/null 1&amp;gt;file&lt;BR /&gt;&lt;BR /&gt;I assume (because of the grep "data") that all output lines you want to see contain the text "data" somewhere.&lt;BR /&gt;&lt;BR /&gt;You could make the selectivity more accurate, if you knew, that the text appears alway at the beginning of the line (grep "^data") or at the end of the line (grep "data$").&lt;BR /&gt;Maybe you don't need the grep at all.&lt;BR /&gt;&lt;BR /&gt;If the output cannot be separated from the menu in the described way, then a small awk script could help:&lt;BR /&gt;&lt;BR /&gt;    ...&lt;BR /&gt;    } |&lt;BR /&gt;    awk '/^Choice:/ { xxx=1 }&lt;BR /&gt;         xxx&lt;BR /&gt;    '&lt;BR /&gt;&lt;BR /&gt;Regards, Klaus</description>
      <pubDate>Thu, 06 Sep 2001 07:50:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576125#M858367</guid>
      <dc:creator>Klaus Crusius</dc:creator>
      <dc:date>2001-09-06T07:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem on scripting.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576126#M858368</link>
      <description>&lt;BR /&gt;Correction:&lt;BR /&gt;&lt;BR /&gt;   awk '/^Choice:/ { xxx=1; next }&lt;BR /&gt;    .....&lt;BR /&gt;&lt;BR /&gt;Klaus</description>
      <pubDate>Thu, 06 Sep 2001 08:08:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576126#M858368</guid>
      <dc:creator>Klaus Crusius</dc:creator>
      <dc:date>2001-09-06T08:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem on scripting.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576127#M858369</link>
      <description>Thanks Klaus.&lt;BR /&gt;Actually your first answer had solved my problem.</description>
      <pubDate>Thu, 06 Sep 2001 08:44:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-on-scripting/m-p/2576127#M858369</guid>
      <dc:creator>Kenny Chau</dc:creator>
      <dc:date>2001-09-06T08:44:52Z</dc:date>
    </item>
  </channel>
</rss>

