<?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: stdout redirect in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644948#M879451</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If I understand your question, you don't need to do anything.&lt;BR /&gt;&lt;BR /&gt;backup &amp;gt; backup.log &amp;amp;&lt;BR /&gt;ls&lt;BR /&gt;echo "Test"&lt;BR /&gt;&lt;BR /&gt;In this example, only stdout from the command backup will be redirected to stdout. The output&lt;BR /&gt;from the commands ls and echo "Test" will then appear on your terminal (assuming that your terminal is stdout). Notice also that since you dropped backup into the background that the next two commands execute immediately. If you are trying something like:&lt;BR /&gt;&lt;BR /&gt;backup &amp;gt; backup.log &amp;amp;&lt;BR /&gt;backup2 &amp;gt; backup2.log &amp;amp;&lt;BR /&gt;backup3 &amp;gt; backup.log &amp;amp;&lt;BR /&gt;wait&lt;BR /&gt;echo "Test"&lt;BR /&gt;&lt;BR /&gt;Then all three of the background commands must complete before wait allows the echo statement to execute.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay&lt;BR /&gt;</description>
    <pubDate>Wed, 16 Jan 2002 01:53:18 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2002-01-16T01:53:18Z</dc:date>
    <item>
      <title>stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644943#M879446</link>
      <description>How can I redirect the stdout?&lt;BR /&gt;&lt;BR /&gt;For example if I have direct the stdout to a file, can I redirect the stdout to a terminal later?</description>
      <pubDate>Tue, 15 Jan 2002 08:48:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644943#M879446</guid>
      <dc:creator>Ryan Ma</dc:creator>
      <dc:date>2002-01-15T08:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644944#M879447</link>
      <description>Hi Ryan,&lt;BR /&gt;&lt;BR /&gt;If you are saying that you redirected stdout by typing:&lt;BR /&gt;&lt;BR /&gt;exec 1&amp;gt;filename&lt;BR /&gt;&lt;BR /&gt;then to get it back to redirecting to the terminal, just type:&lt;BR /&gt;&lt;BR /&gt;exec 1&amp;gt;/dev/tty&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Tue, 15 Jan 2002 08:55:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644944#M879447</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-01-15T08:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644945#M879448</link>
      <description>you should be able to cat it to the tty (or redirect) once&lt;BR /&gt;&lt;BR /&gt;ie&lt;BR /&gt;pereal:root&amp;gt; who am i&lt;BR /&gt;root       ttyp2        Jan 15 09:54&lt;BR /&gt;pereal:root&amp;gt; hello&lt;BR /&gt;---&lt;BR /&gt;&lt;BR /&gt;pereal:root&amp;gt; who am i&lt;BR /&gt;root       ttyp1        Jan 15 09:54&lt;BR /&gt;pereal:root&amp;gt;echo "hello" &amp;gt; /dev/ttyp2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;pereal:root&amp;gt; ll /dev/ttyp2&lt;BR /&gt;cr--------   2 root       tty         17 0x000002 Jan 15 09:56 /dev/ttyp2&lt;BR /&gt;&lt;BR /&gt;even when &lt;BR /&gt;pereal:root&amp;gt; mesg&lt;BR /&gt;is n&lt;BR /&gt;&lt;BR /&gt;Later,&lt;BR /&gt;Bill&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Jan 2002 08:56:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644945#M879448</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2002-01-15T08:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644946#M879449</link>
      <description>if you want to redirect output to both terminal and file&lt;BR /&gt;&lt;BR /&gt;#command | tee filename&lt;BR /&gt;like&lt;BR /&gt;&lt;BR /&gt;#ll | tee file_list</description>
      <pubDate>Tue, 15 Jan 2002 09:12:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644946#M879449</guid>
      <dc:creator>Printaporn_1</dc:creator>
      <dc:date>2002-01-15T09:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644947#M879450</link>
      <description>I have to make it clear.&lt;BR /&gt;Please read the example.&lt;BR /&gt;&lt;BR /&gt;# backup &amp;gt; backup.log &amp;amp;&lt;BR /&gt;&lt;BR /&gt;After running the command, can I make the stdout to other places such as tty when I have already assigned it to backup.log before and vice versa.</description>
      <pubDate>Wed, 16 Jan 2002 01:38:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644947#M879450</guid>
      <dc:creator>Ryan Ma</dc:creator>
      <dc:date>2002-01-16T01:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644948#M879451</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If I understand your question, you don't need to do anything.&lt;BR /&gt;&lt;BR /&gt;backup &amp;gt; backup.log &amp;amp;&lt;BR /&gt;ls&lt;BR /&gt;echo "Test"&lt;BR /&gt;&lt;BR /&gt;In this example, only stdout from the command backup will be redirected to stdout. The output&lt;BR /&gt;from the commands ls and echo "Test" will then appear on your terminal (assuming that your terminal is stdout). Notice also that since you dropped backup into the background that the next two commands execute immediately. If you are trying something like:&lt;BR /&gt;&lt;BR /&gt;backup &amp;gt; backup.log &amp;amp;&lt;BR /&gt;backup2 &amp;gt; backup2.log &amp;amp;&lt;BR /&gt;backup3 &amp;gt; backup.log &amp;amp;&lt;BR /&gt;wait&lt;BR /&gt;echo "Test"&lt;BR /&gt;&lt;BR /&gt;Then all three of the background commands must complete before wait allows the echo statement to execute.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Jan 2002 01:53:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644948#M879451</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-01-16T01:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644949#M879452</link>
      <description>Oops ....&lt;BR /&gt;&lt;BR /&gt;I should have said:&lt;BR /&gt;In this example, only stdout from the command backup will be redirected to the file 'backup.log'.</description>
      <pubDate>Wed, 16 Jan 2002 02:03:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644949#M879452</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-01-16T02:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644950#M879453</link>
      <description>In fact, when the following command is run.&lt;BR /&gt;&lt;BR /&gt;# backup &amp;gt; backup.log&lt;BR /&gt;&lt;BR /&gt;The stdout is redirected to backup.log&lt;BR /&gt;&lt;BR /&gt;And now I want this existing redirection back to terminal (tty) again.&lt;BR /&gt;&lt;BR /&gt;Can I do that?</description>
      <pubDate>Wed, 16 Jan 2002 02:27:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644950#M879453</guid>
      <dc:creator>Ryan Ma</dc:creator>
      <dc:date>2002-01-16T02:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644951#M879454</link>
      <description>Hi Ryan:&lt;BR /&gt;&lt;BR /&gt;I'll try again because I don't think I understand your question.&lt;BR /&gt;&lt;BR /&gt;backup &amp;gt; backup.log&lt;BR /&gt;&lt;BR /&gt;In this case only the stdout from the command 'backup' is sent to the file backup.log but your terminal seems hung because it must wait for the command to complete. As soon as backup has finished, output to your terminal then resumes normally.&lt;BR /&gt;&lt;BR /&gt;If you want to then send the contents of 'backup.log' to your terminal then that is nothing more than 'cat backup.log'. I think the best way to determine what you are doing is to experiment with a diffrent command that doesn't take so long to complete. I suggest that you temporarily substitute something like&lt;BR /&gt;'ls /tmp &amp;gt; backup.log' for you backup command just so you can get an idea of how to proceed.&lt;BR /&gt;&lt;BR /&gt;Clay</description>
      <pubDate>Wed, 16 Jan 2002 04:26:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644951#M879454</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-01-16T04:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644952#M879455</link>
      <description>Sorry I have not typed &amp;amp; at the end of command.&lt;BR /&gt;&lt;BR /&gt;It seems there is no way to do that and I must do this&lt;BR /&gt;&lt;BR /&gt;# tail -f backup.log&lt;BR /&gt;&lt;BR /&gt;I just want to make the stdout back to tty after I have submitted the command&lt;BR /&gt;&lt;BR /&gt;# backup &amp;gt; backup.log &amp;amp;&lt;BR /&gt;&lt;BR /&gt;so that the result as if I have submitted this command&lt;BR /&gt;&lt;BR /&gt;# backup &amp;amp;</description>
      <pubDate>Thu, 17 Jan 2002 02:52:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644952#M879455</guid>
      <dc:creator>Ryan Ma</dc:creator>
      <dc:date>2002-01-17T02:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644953#M879456</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I think if I you understand, you have to use the tee command like this:&lt;BR /&gt;backup | tee backup.log or&lt;BR /&gt;backup | tee backup.log &amp;amp;&lt;BR /&gt;&lt;BR /&gt;Now your output is redirected to backup.log and also to tty.&lt;BR /&gt;&lt;BR /&gt;I use often (for this example):&lt;BR /&gt;backup 2&amp;gt;&amp;amp;1 | tee backup.log&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;Ruediger&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Jan 2002 07:30:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644953#M879456</guid>
      <dc:creator>Ruediger Noack</dc:creator>
      <dc:date>2002-01-17T07:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644954#M879457</link>
      <description>Using command tee can reserve the stdout to tty and at the same time write it to a file.&lt;BR /&gt;&lt;BR /&gt;But I want it first redirect to a file, then later I want it back to tty.&lt;BR /&gt;&lt;BR /&gt;Or can I transfer the stdout to another tty?</description>
      <pubDate>Thu, 17 Jan 2002 08:37:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644954#M879457</guid>
      <dc:creator>Ryan Ma</dc:creator>
      <dc:date>2002-01-17T08:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644955#M879458</link>
      <description>Ryan,&lt;BR /&gt;&lt;BR /&gt;try this:&lt;BR /&gt;&lt;BR /&gt;backup | tee backup.log &amp;gt; &lt;OTHER_TTY&gt;&lt;BR /&gt;&lt;BR /&gt;Ruediger&lt;BR /&gt;&lt;/OTHER_TTY&gt;</description>
      <pubDate>Thu, 17 Jan 2002 08:47:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644955#M879458</guid>
      <dc:creator>Ruediger Noack</dc:creator>
      <dc:date>2002-01-17T08:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644956#M879459</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; # backup &amp;gt; backup.log &amp;amp;&lt;BR /&gt;&lt;BR /&gt;Note that if you want all errors to be recorded as well, you should log the STDERR as well:&lt;BR /&gt;&lt;BR /&gt;# backup &amp;gt; backup.log 2&amp;gt;&amp;amp;1 &amp;amp;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; But I want it first redirect to a file, then later I want it back to tty. &lt;BR /&gt;&amp;gt;&amp;gt; Or can I transfer the stdout to another tty? &lt;BR /&gt;&lt;BR /&gt;To direct it back to the tty, run (as what Bill has mentioned):&lt;BR /&gt;&lt;BR /&gt;# cat backup.log &amp;gt; /dev/ttyp0&lt;BR /&gt;&lt;BR /&gt;If you want another tty say /dev/ttyp2, then:&lt;BR /&gt;&lt;BR /&gt;# cat backup.log &amp;gt; /dev/ttyp2&lt;BR /&gt;&lt;BR /&gt;If you want it to be displayed on your current login tty, then:&lt;BR /&gt;&lt;BR /&gt;# cat backup.log&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Thu, 17 Jan 2002 08:48:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644956#M879459</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-01-17T08:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644957#M879460</link>
      <description>I usually think that there is a way to "redirect the stdout back to tty after you redirect it to a file".  If I success bringing it back, then I can do something interactively such as press Ctrl-C to stop it.&lt;BR /&gt;&lt;BR /&gt;*********************************&lt;BR /&gt;&lt;BR /&gt;If you just "cat" the log file, then you are submitting another command to view the log file rather than re-redirect the stdout back to tty.&lt;BR /&gt;&lt;BR /&gt;Also, if you use "cat", then you will not get further information from the log file since it may be kept updating.  So using "tail -f" may be more appopriate.&lt;BR /&gt;&lt;BR /&gt;*********************************&lt;BR /&gt;&lt;BR /&gt;May be I am just thinking something that doesn't exist.&lt;BR /&gt;&lt;BR /&gt;Thanks for all of you discussing this.</description>
      <pubDate>Thu, 17 Jan 2002 09:09:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644957#M879460</guid>
      <dc:creator>Ryan Ma</dc:creator>
      <dc:date>2002-01-17T09:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644958#M879461</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Now I think I get what you mean. You want to pass control from a background process back to the foreground while being able to view the output of the process, yet log this output to a file. &lt;BR /&gt;&lt;BR /&gt;Correct me if I am wrong.&lt;BR /&gt;&lt;BR /&gt;In that case, then you should execute:&lt;BR /&gt;&lt;BR /&gt;# backup | tee backup.log &amp;amp; # this will display output on the screen, log to a file while the backup continues running.&lt;BR /&gt;&lt;BR /&gt;# fg # this will bring the backup process back up in the foreground for you to execute a ctrl-c to abort the backup.&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Thu, 17 Jan 2002 09:19:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644958#M879461</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-01-17T09:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644959#M879462</link>
      <description>Yup.&lt;BR /&gt;&lt;BR /&gt;I want to transfer the stdout to a file or other tty.&lt;BR /&gt;&lt;BR /&gt;And if another tty get the stdout, the result should be as if it is originally submitted from that tty.</description>
      <pubDate>Thu, 17 Jan 2002 09:30:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644959#M879462</guid>
      <dc:creator>Ryan Ma</dc:creator>
      <dc:date>2002-01-17T09:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: stdout redirect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644960#M879463</link>
      <description>Hi Ryan,&lt;BR /&gt;&lt;BR /&gt;your last answer confuses me.&lt;BR /&gt;You want to start and control your job from first tty and you need a additional output to a file or another tty. The output has to be the same. Isn't ??t?&lt;BR /&gt;And the job has to run in background or not.&lt;BR /&gt;If is so, I don't see the problem.&lt;BR /&gt;&lt;BR /&gt;Ruediger&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Jan 2002 09:48:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stdout-redirect/m-p/2644960#M879463</guid>
      <dc:creator>Ruediger Noack</dc:creator>
      <dc:date>2002-01-17T09:48:15Z</dc:date>
    </item>
  </channel>
</rss>

