<?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: control (enable/disable) redirect to /dev/null in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/control-enable-disable-redirect-to-dev-null/m-p/4393395#M681695</link>
    <description>thx for the fast answer.&lt;BR /&gt;can i redirect to stdout maybe for a message which should always appear ?&lt;BR /&gt;&lt;BR /&gt;[ ${DEBUG} = 0 ] &amp;amp;&amp;amp; exec &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;echo "...this you don't see if debugging off..."&lt;BR /&gt;&lt;BR /&gt;echo "other output ..."&lt;BR /&gt;&lt;BR /&gt;the command for redirect to stdout ?&lt;BR /&gt;exec &amp;gt;&amp;amp; - &lt;BR /&gt;echo "output allways appears"&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;</description>
    <pubDate>Thu, 02 Apr 2009 13:23:28 GMT</pubDate>
    <dc:creator>Billa-User</dc:creator>
    <dc:date>2009-04-02T13:23:28Z</dc:date>
    <item>
      <title>control (enable/disable) redirect to /dev/null</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-enable-disable-redirect-to-dev-null/m-p/4393393#M681693</link>
      <description>hello,&lt;BR /&gt;&lt;BR /&gt;how can i control (enable/disable) redirect to /dev/null in script ? for example, when a variable DEBUG hasn't value "Y", output redirect to /dev/null. if value "Y", i should see the output. i need this for disable/enable oracle "sqlplus" output in a ksh script.&lt;BR /&gt;&lt;BR /&gt;i read forum entry "about redirect"&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=858713" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=858713&lt;/A&gt;&lt;BR /&gt;and find two solutions :&lt;BR /&gt;&lt;BR /&gt;1. script : based on forum entry:&lt;BR /&gt;&lt;BR /&gt;DEBUG=""&lt;BR /&gt;&lt;BR /&gt;if [ "${DEBUG}" = "Y" ]&lt;BR /&gt;then&lt;BR /&gt;  OUTPUTDEVNULL=""  # i should see the output&lt;BR /&gt;else&lt;BR /&gt;  OUTPUTDEVNULL="/dev/null"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo "test" &amp;gt; ${OUTPUTDEVNULL} 2&amp;gt;&amp;amp;&lt;BR /&gt;&lt;BR /&gt;2. script : example with exec &lt;BR /&gt;DEBUG=""&lt;BR /&gt;&lt;BR /&gt;if [ "${DEBUG}" = "Y" ]&lt;BR /&gt;then&lt;BR /&gt;  exec 3&amp;gt;&amp;amp;2   # i should see the output&lt;BR /&gt;else&lt;BR /&gt;  exec 3&amp;gt;/dev/null  &lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo "test" &amp;gt;&amp;amp;3&lt;BR /&gt;&lt;BR /&gt;exec 3&amp;gt;&amp;amp;-  # close the file descriptor&lt;BR /&gt;&lt;BR /&gt;what i the best solution ? other way to solve this ?&lt;BR /&gt;regards</description>
      <pubDate>Thu, 02 Apr 2009 10:14:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-enable-disable-redirect-to-dev-null/m-p/4393393#M681693</guid>
      <dc:creator>Billa-User</dc:creator>
      <dc:date>2009-04-02T10:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: control (enable/disable) redirect to /dev/null</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-enable-disable-redirect-to-dev-null/m-p/4393394#M681694</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;I use something like this:&lt;BR /&gt;&lt;BR /&gt;# cat ./debug.sh&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;DEBUG=0 &amp;amp;&amp;amp;  [ "${1}" = "-d" ] &amp;amp;&amp;amp; DEBUG=1&lt;BR /&gt;echo "...this is output..."&lt;BR /&gt;[ ${DEBUG} = 0 ] &amp;amp;&amp;amp; exec &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;echo "...this you don't see if debugging off..."&lt;BR /&gt;&lt;BR /&gt;...run:&lt;BR /&gt;&lt;BR /&gt;# ./debug.sh&lt;BR /&gt;&lt;BR /&gt;...and compare to:&lt;BR /&gt;&lt;BR /&gt;# ./debug.sh -d&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 02 Apr 2009 11:15:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-enable-disable-redirect-to-dev-null/m-p/4393394#M681694</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-02T11:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: control (enable/disable) redirect to /dev/null</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-enable-disable-redirect-to-dev-null/m-p/4393395#M681695</link>
      <description>thx for the fast answer.&lt;BR /&gt;can i redirect to stdout maybe for a message which should always appear ?&lt;BR /&gt;&lt;BR /&gt;[ ${DEBUG} = 0 ] &amp;amp;&amp;amp; exec &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;echo "...this you don't see if debugging off..."&lt;BR /&gt;&lt;BR /&gt;echo "other output ..."&lt;BR /&gt;&lt;BR /&gt;the command for redirect to stdout ?&lt;BR /&gt;exec &amp;gt;&amp;amp; - &lt;BR /&gt;echo "output allways appears"&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Apr 2009 13:23:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-enable-disable-redirect-to-dev-null/m-p/4393395#M681695</guid>
      <dc:creator>Billa-User</dc:creator>
      <dc:date>2009-04-02T13:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: control (enable/disable) redirect to /dev/null</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-enable-disable-redirect-to-dev-null/m-p/4393396#M681696</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;Why not use STDERR for what is is intended (?):&lt;BR /&gt;&lt;BR /&gt;# cat ./debug.sh&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;DEBUG=0 &amp;amp;&amp;amp;  [ "${1}" = "-d" ] &amp;amp;&amp;amp; DEBUG=1&lt;BR /&gt;echo "...this is output..."&lt;BR /&gt;[ ${DEBUG} = 0 ] &amp;amp;&amp;amp; exec &amp;gt; /dev/null&lt;BR /&gt;echo "...this you don't see if debugging off..."&lt;BR /&gt;print -u2 "...STDERR reporting here..."&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 02 Apr 2009 13:28:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-enable-disable-redirect-to-dev-null/m-p/4393396#M681696</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-02T13:28:17Z</dc:date>
    </item>
  </channel>
</rss>

