<?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: How to redirect STDERR to STDOUT for shell command execution ? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-redirect-stderr-to-stdout-for-shell-command-execution/m-p/4715461#M660215</link>
    <description>Hi :&lt;BR /&gt;&lt;BR /&gt;The order of redirection matters.  I assume that you want to discard STDERR messages like those for non-existent operands.&lt;BR /&gt;&lt;BR /&gt;# ls -l aa 2&amp;gt;/dev/null &lt;BR /&gt;&lt;BR /&gt;In your case, you assigned file descriptor 2 to be the same as descriptor 1 whereas you want them segregated. &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Fri, 19 Nov 2010 13:11:51 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2010-11-19T13:11:51Z</dc:date>
    <item>
      <title>How to redirect STDERR to STDOUT for shell command execution ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-redirect-stderr-to-stdout-for-shell-command-execution/m-p/4715460#M660214</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am going to use popen, faceing one difficulty to get the console output when command execution fails.&lt;BR /&gt;&lt;BR /&gt;In Suse10 i am doing this way,&lt;BR /&gt;&lt;BR /&gt;popen("ls -l aa &amp;gt; /dev/stdout 2&amp;gt;&amp;amp;1")    where 'aa' directory is not present.&lt;BR /&gt;&lt;BR /&gt;Actually here i am gettting error string from console without creating any extra temporary file.&lt;BR /&gt;&lt;BR /&gt;How can i do the thing in HP-UX ?&lt;BR /&gt;&lt;BR /&gt;-ashokd</description>
      <pubDate>Fri, 19 Nov 2010 11:57:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-redirect-stderr-to-stdout-for-shell-command-execution/m-p/4715460#M660214</guid>
      <dc:creator>ashokd</dc:creator>
      <dc:date>2010-11-19T11:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to redirect STDERR to STDOUT for shell command execution ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-redirect-stderr-to-stdout-for-shell-command-execution/m-p/4715461#M660215</link>
      <description>Hi :&lt;BR /&gt;&lt;BR /&gt;The order of redirection matters.  I assume that you want to discard STDERR messages like those for non-existent operands.&lt;BR /&gt;&lt;BR /&gt;# ls -l aa 2&amp;gt;/dev/null &lt;BR /&gt;&lt;BR /&gt;In your case, you assigned file descriptor 2 to be the same as descriptor 1 whereas you want them segregated. &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 19 Nov 2010 13:11:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-redirect-stderr-to-stdout-for-shell-command-execution/m-p/4715461#M660215</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-11-19T13:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to redirect STDERR to STDOUT for shell command execution ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-redirect-stderr-to-stdout-for-shell-command-execution/m-p/4715462#M660216</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;What hasn't been answered?&lt;BR /&gt;&lt;BR /&gt;If you want to capture STDOUT in a temporary file, do something like:&lt;BR /&gt;&lt;BR /&gt;# ls -l aa 2&amp;gt;/dev/null &amp;gt; mylog&lt;BR /&gt;&lt;BR /&gt;...or, to write STDOUT to both your terminal and a file:&lt;BR /&gt;&lt;BR /&gt;# ls -l aa 2&amp;gt;/dev/null | tee mylog&lt;BR /&gt;&lt;BR /&gt;in either case, if 'aa' doesn't exist, 'mylog' will be empty by will be created anyway.  Change '&amp;gt;' to '&amp;gt;&amp;gt;' or add '-a' to the 'tee' command to append to the file.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 19 Nov 2010 14:50:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-redirect-stderr-to-stdout-for-shell-command-execution/m-p/4715462#M660216</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-11-19T14:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to redirect STDERR to STDOUT for shell command execution ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-redirect-stderr-to-stdout-for-shell-command-execution/m-p/4715463#M660217</link>
      <description>&amp;gt;facing one difficulty to get the console output when command execution fails.&lt;BR /&gt;popen("ls -l aa &amp;gt; /dev/stdout 2&amp;gt;&amp;amp;1")&lt;BR /&gt;&lt;BR /&gt;You don't want that output to go to the program?  You could try /dev/tty instead.</description>
      <pubDate>Sat, 20 Nov 2010 07:12:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-redirect-stderr-to-stdout-for-shell-command-execution/m-p/4715463#M660217</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-20T07:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to redirect STDERR to STDOUT for shell command execution ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-redirect-stderr-to-stdout-for-shell-command-execution/m-p/4715464#M660218</link>
      <description>popen("ls -l aa 2&amp;gt;&amp;amp;1") &lt;BR /&gt;if you want to get the result of the ls and the error messages on the pipe&lt;BR /&gt;&lt;BR /&gt;popen("ls -l aa &amp;gt;/dev/tty 2&amp;gt;&amp;amp;1")&lt;BR /&gt;if you want to get the result on the current control terminal for that session.&lt;BR /&gt;&lt;BR /&gt;popen("ls -l aa 2&amp;gt;&amp;amp;1 &amp;gt;/dev/tty") if you want to get the result to the control tty of the session but the error message to the pipe.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Nov 2010 13:29:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-redirect-stderr-to-stdout-for-shell-command-execution/m-p/4715464#M660218</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2010-11-22T13:29:28Z</dc:date>
    </item>
  </channel>
</rss>

