<?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: Why return code is not 0  on this script ? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/why-return-code-is-not-0-on-this-script/m-p/4673071#M658511</link>
    <description>Thanks Matti. Makes sense.</description>
    <pubDate>Tue, 10 Aug 2010 19:41:14 GMT</pubDate>
    <dc:creator>Sammy_2</dc:creator>
    <dc:date>2010-08-10T19:41:14Z</dc:date>
    <item>
      <title>Why return code is not 0  on this script ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-return-code-is-not-0-on-this-script/m-p/4673069#M658509</link>
      <description>Why do I get return code of 1 when I grep -v (all lines) in a file ? If there is something left in the file , then I get 0 return code.&lt;BR /&gt;&lt;BR /&gt;# cat test&lt;BR /&gt;echo hi&lt;BR /&gt;echo I am here&lt;BR /&gt;&lt;BR /&gt;# grep -v echo test&lt;BR /&gt;# echo $?&lt;BR /&gt;1&lt;BR /&gt;&lt;BR /&gt;Also</description>
      <pubDate>Tue, 10 Aug 2010 19:27:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-return-code-is-not-0-on-this-script/m-p/4673069#M658509</guid>
      <dc:creator>Sammy_2</dc:creator>
      <dc:date>2010-08-10T19:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why return code is not 0  on this script ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-return-code-is-not-0-on-this-script/m-p/4673070#M658510</link>
      <description>The "-v" option inverts the sense of the search, i.e. searching for lines that _don't_ match the given pattern.&lt;BR /&gt;&lt;BR /&gt;Your file "test" does not contain any lines that _don't_ have the word "echo" in them, so the search result is "nothing acceptable was found". The return code is set to 1 to indicate that.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Tue, 10 Aug 2010 19:39:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-return-code-is-not-0-on-this-script/m-p/4673070#M658510</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2010-08-10T19:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why return code is not 0  on this script ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-return-code-is-not-0-on-this-script/m-p/4673071#M658511</link>
      <description>Thanks Matti. Makes sense.</description>
      <pubDate>Tue, 10 Aug 2010 19:41:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-return-code-is-not-0-on-this-script/m-p/4673071#M658511</guid>
      <dc:creator>Sammy_2</dc:creator>
      <dc:date>2010-08-10T19:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why return code is not 0  on this script ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-return-code-is-not-0-on-this-script/m-p/4673072#M658512</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The return code from 'grep' will be:&lt;BR /&gt;&lt;BR /&gt;0 = One or more matches found.&lt;BR /&gt;1 = No match found.&lt;BR /&gt;2 = Syntax error or inaccessible file (even if matches were found)&lt;BR /&gt;&lt;BR /&gt;In your case, there are no lines that *don't* have the string "echo" so there are no matches and thus the return code is one (1).&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 10 Aug 2010 19:44:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-return-code-is-not-0-on-this-script/m-p/4673072#M658512</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-08-10T19:44:49Z</dc:date>
    </item>
  </channel>
</rss>

