<?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: POSIX Shell programing issue in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078102#M92371</link>
    <description>Thanks for all!!! &lt;BR /&gt;&lt;BR /&gt;Tim and Clay show me two different ways to do. Now i have to run some test to determine which one of them is the best one for me.&lt;BR /&gt;&lt;BR /&gt;Regards!</description>
    <pubDate>Mon, 05 Nov 2007 18:08:46 GMT</pubDate>
    <dc:creator>Andres_13</dc:creator>
    <dc:date>2007-11-05T18:08:46Z</dc:date>
    <item>
      <title>POSIX Shell programing issue</title>
      <link>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078095#M92364</link>
      <description>Hi all&lt;BR /&gt;&lt;BR /&gt;I´m a newby in POSIX shell programing and i have this issue:&lt;BR /&gt;&lt;BR /&gt;need to run a program which first ask for an option and again ask for another option and then it starts to refresh some data in the display.&lt;BR /&gt;&lt;BR /&gt;My question is what i can do to get the n the data the program prints in the screen into a text file assuming that i don´t be able to modify such program.</description>
      <pubDate>Mon, 05 Nov 2007 17:30:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078095#M92364</guid>
      <dc:creator>Andres_13</dc:creator>
      <dc:date>2007-11-05T17:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: POSIX Shell programing issue</title>
      <link>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078096#M92365</link>
      <description>Nothing more coplicated than redirecting stdout to a file.&lt;BR /&gt;&lt;BR /&gt;Let's suppose that you want to capture the output of "ls /etc" to a file:&lt;BR /&gt;&lt;BR /&gt;OUTFILE=/var/tmp/myfile&lt;BR /&gt;ls /etc &amp;gt; ${OUTFILE}&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Nov 2007 17:42:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078096#M92365</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-11-05T17:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: POSIX Shell programing issue</title>
      <link>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078097#M92366</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# ./myscript &amp;gt; ./myscript.log&lt;BR /&gt;&lt;BR /&gt;# ./myscript &amp;gt;&amp;gt; ./myscript.log&lt;BR /&gt;&lt;BR /&gt;...the first truncates (clears) 'myscript.log' if it exists or creates an empty file if it doesn't and then writes the output (STDOUT) to it.&lt;BR /&gt;&lt;BR /&gt;The second appends STDOUT to 'myscript.log' adding any new data to that already present.&lt;BR /&gt;&lt;BR /&gt;I suggest this link for a quick overview of the POSIX shell:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.docs.hp.com/en/B2355-90046/index.html" target="_blank"&gt;http://www.docs.hp.com/en/B2355-90046/index.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Don't forget to read and keep handy the 'sh-posix(1)' manpages, either:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.docs.hp.com/en/B2355-60105/sh-posix.1.html" target="_blank"&gt;http://www.docs.hp.com/en/B2355-60105/sh-posix.1.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 05 Nov 2007 17:42:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078097#M92366</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-11-05T17:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: POSIX Shell programing issue</title>
      <link>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078098#M92367</link>
      <description>If you want to see what is happening on the screen and also send the output to a log you can use the "tee" command.&lt;BR /&gt;&lt;BR /&gt;./myscript |tee -a my.log&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Nov 2007 17:46:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078098#M92367</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2007-11-05T17:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: POSIX Shell programing issue</title>
      <link>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078099#M92368</link>
      <description>Thanks for the quick response guys, but that isn't what i need.&lt;BR /&gt;&lt;BR /&gt;Let's say: run "/tmp/programX pf=/tmp/profile" when the program starts it prompts for an input (at this point i have to hit "m" and then have to hit "l"); the output that comes after all this is the one i need to log into a text file.&lt;BR /&gt;&lt;BR /&gt;The question is how?, any clues?&lt;BR /&gt;&lt;BR /&gt;Thanks and regards!</description>
      <pubDate>Mon, 05 Nov 2007 17:53:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078099#M92368</guid>
      <dc:creator>Andres_13</dc:creator>
      <dc:date>2007-11-05T17:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: POSIX Shell programing issue</title>
      <link>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078100#M92369</link>
      <description>You can always script(1) your session so that all your inputs and outputs are recorded in the file typescript. See the mapage of script(1) for details.</description>
      <pubDate>Mon, 05 Nov 2007 18:02:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078100#M92369</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-11-05T18:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: POSIX Shell programing issue</title>
      <link>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078101#M92370</link>
      <description>That's bit more complicated and there is no simple way to redirect stdout in the middle of a process --- unless the process itself were coded to accept signals. In you particular case, you need to redirect stdin and stdout.&lt;BR /&gt;&lt;BR /&gt;INFILE=/var/tmp/myinfile&lt;BR /&gt;OUTFILE=/var/tmp/myoutfile&lt;BR /&gt;# The following is a here docs that will&lt;BR /&gt;# put an m&lt;LF&gt; and l&lt;LF&gt; into a file.&lt;BR /&gt;&lt;BR /&gt;cat &amp;lt;&amp;lt; !EOF! &amp;gt; ${INFILE}&lt;BR /&gt;m&lt;BR /&gt;l&lt;BR /&gt;!EOF!&lt;BR /&gt;&lt;BR /&gt;myprof pf=xxx &amp;lt; ${INFILE} &amp;gt; ${OUTFILE}&lt;BR /&gt;rm -f ${INFILE}&lt;BR /&gt;&lt;BR /&gt;At this point, you would then need to pass ${OUTFILE} through a filter (sed, awk, Perl) and remove your first few extraneous lines.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LF&gt;&lt;/LF&gt;</description>
      <pubDate>Mon, 05 Nov 2007 18:02:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078101#M92370</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-11-05T18:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: POSIX Shell programing issue</title>
      <link>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078102#M92371</link>
      <description>Thanks for all!!! &lt;BR /&gt;&lt;BR /&gt;Tim and Clay show me two different ways to do. Now i have to run some test to determine which one of them is the best one for me.&lt;BR /&gt;&lt;BR /&gt;Regards!</description>
      <pubDate>Mon, 05 Nov 2007 18:08:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/posix-shell-programing-issue/m-p/5078102#M92371</guid>
      <dc:creator>Andres_13</dc:creator>
      <dc:date>2007-11-05T18:08:46Z</dc:date>
    </item>
  </channel>
</rss>

