<?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: Disable error messge in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812823#M84745</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;No.  The segregation of normal output (stdout) and error messages into 'stdout' and 'stderr', respectively, is expected for well-written utilities (and scripts).  It allows just what you have seen.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Wed, 25 Sep 2002 04:59:22 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2002-09-25T04:59:22Z</dc:date>
    <item>
      <title>Disable error messge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812820#M84742</link>
      <description>When use 'ls' to list a not available file (eg. `ls testfile` ) , then it would pop up error message  `testfile not found ' ,  how can i disable  such error message (except output the error to null value ( 2 &amp;gt; /dev/null ) ? Thanks.</description>
      <pubDate>Wed, 25 Sep 2002 04:29:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812820#M84742</guid>
      <dc:creator>O'lnes</dc:creator>
      <dc:date>2002-09-25T04:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Disable error messge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812821#M84743</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You already have the answer.  Redirect stderr to /dev/null.  You can still interrogate the return value from 'ls' to determine whether there were any errors or if all file(s) were listed.  For instance:&lt;BR /&gt;&lt;BR /&gt;# ls -l /tmp/myfile /tmp/yourfile 2&amp;gt;/dev/null&lt;BR /&gt;# echo $?&lt;BR /&gt;&lt;BR /&gt;...would return the listing for &lt;MYFILE&gt; if it were present, but would suppress the message "/tmp/yourfile not found" if &lt;YOURFILE&gt; was not present.  The return value from 'ls' would be non-zero to denote the an exception condition, however.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/YOURFILE&gt;&lt;/MYFILE&gt;</description>
      <pubDate>Wed, 25 Sep 2002 04:49:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812821#M84743</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-09-25T04:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Disable error messge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812822#M84744</link>
      <description>Is there other methods or command can also disable the messaage? Thanks.</description>
      <pubDate>Wed, 25 Sep 2002 04:52:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812822#M84744</guid>
      <dc:creator>O'lnes</dc:creator>
      <dc:date>2002-09-25T04:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Disable error messge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812823#M84745</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;No.  The segregation of normal output (stdout) and error messages into 'stdout' and 'stderr', respectively, is expected for well-written utilities (and scripts).  It allows just what you have seen.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 25 Sep 2002 04:59:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812823#M84745</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-09-25T04:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Disable error messge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812824#M84746</link>
      <description>One other way occurs to me, however.  You could create an alias that you would use instead of 'ls', which would run either the redirect to /dev/null sequence outlined by JRF, or possibly something else like &lt;BR /&gt;&lt;BR /&gt;ls $1 2&amp;gt;&amp;amp;1 | grep -v " not "&lt;BR /&gt;&lt;BR /&gt;(presuming that unix file names will not have spaces)&lt;BR /&gt;&lt;BR /&gt;I'm not in a position to try this approach just now, but it should work with some tweaking as needed.&lt;BR /&gt;&lt;BR /&gt;I also wouldn't recommend making an alias named ls, since, as JRF points out, an error upon failure is normal behavior for ls (and most commands, other than those that intentionally fail silently).  The results might not be predictable or useful if other scripts were to run with ls behaving as you want it to.  Just make yourself a different command that acts like you want it to, via the alias facility.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.  Regards, --bmr</description>
      <pubDate>Wed, 25 Sep 2002 05:26:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812824#M84746</guid>
      <dc:creator>Brian M Rawlings</dc:creator>
      <dc:date>2002-09-25T05:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Disable error messge</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812825#M84747</link>
      <description>thx all.</description>
      <pubDate>Wed, 25 Sep 2002 07:57:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-error-messge/m-p/2812825#M84747</guid>
      <dc:creator>O'lnes</dc:creator>
      <dc:date>2002-09-25T07:57:52Z</dc:date>
    </item>
  </channel>
</rss>

