<?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: rval of nslookup in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561493#M29428</link>
    <description>I get it now, pretty stupid huh, the command worked fine, therefore the exit of 0, just because it did not find a host does not mean the command failed..&lt;BR /&gt;thanks, you know someone could really learn alot from you guys.</description>
    <pubDate>Fri, 03 Aug 2001 17:33:06 GMT</pubDate>
    <dc:creator>Kevin Wright</dc:creator>
    <dc:date>2001-08-03T17:33:06Z</dc:date>
    <item>
      <title>rval of nslookup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561487#M29422</link>
      <description>does anyone know why nslookup is always returning a return value of 0, whether it works or not?&lt;BR /&gt;&lt;BR /&gt;nslookup host &lt;BR /&gt;rval=$?&lt;BR /&gt;if [[ $rval -eq 0 ]];then&lt;BR /&gt;        echo 'it works'&lt;BR /&gt;else&lt;BR /&gt;        echo 'no host'&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;this always returns 'it works' no matter what host yo put in??&lt;BR /&gt;&lt;BR /&gt;I use the rval with grep all the time, and 0 is success, 1 is fail. can this not be done with nslookup?</description>
      <pubDate>Fri, 03 Aug 2001 16:58:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561487#M29422</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2001-08-03T16:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: rval of nslookup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561488#M29423</link>
      <description>Hi Kevin:&lt;BR /&gt;&lt;BR /&gt;There's no rule that you must exit with a zero/non-zero value.  Convention dictates that zero (0) is success and (1) is failure.  Two (2) is often used to denote a "warning".  However, as a writer I could just as easily exit(0), regardless.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 03 Aug 2001 17:08:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561488#M29423</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-08-03T17:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: rval of nslookup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561489#M29424</link>
      <description>Hi,&lt;BR /&gt;Well I would say the command succeeded although it did not find what you were looking for (the command did work) so why not test on something like "can't find host" ?&lt;BR /&gt;&lt;BR /&gt;My  2 cents&lt;BR /&gt;&lt;BR /&gt;ALl the best&lt;BR /&gt;Victor</description>
      <pubDate>Fri, 03 Aug 2001 17:10:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561489#M29424</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2001-08-03T17:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: rval of nslookup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561490#M29425</link>
      <description>Victor is correct.  The command did succeed.  Just because it did not find anything does not cause failure.  FTP works the same way.  It always ends in rval 0.&lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Fri, 03 Aug 2001 17:14:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561490#M29425</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-08-03T17:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: rval of nslookup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561491#M29426</link>
      <description>nslookup has many different functions and the rules it follows determine whether it produces the result you are looking for. For instance, nslookup may be told to look in /etc/hosts first and does not find the hostname so it asks the DNSD server and finds it.  Is that a failure, a success or half a failure?&lt;BR /&gt;&lt;BR /&gt;nslookup is one of many ways to resolve an address.  A better way for your question is the little known command: getip</description>
      <pubDate>Fri, 03 Aug 2001 17:19:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561491#M29426</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2001-08-03T17:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: rval of nslookup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561492#M29427</link>
      <description>Hi Kevin:&lt;BR /&gt;&lt;BR /&gt;Welcome to UNIX, just because the rules and conventions are there doesn't mean the developer has to follow them. Sometimes you have to do string patterm matching (and this is one of them); sometimes you have to look at the 3rd column of the 10th line of output to &lt;BR /&gt;know it a command succeeded. &lt;BR /&gt;&lt;BR /&gt;If you really want to be frustrated try using remsh.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
      <pubDate>Fri, 03 Aug 2001 17:19:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561492#M29427</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-08-03T17:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: rval of nslookup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561493#M29428</link>
      <description>I get it now, pretty stupid huh, the command worked fine, therefore the exit of 0, just because it did not find a host does not mean the command failed..&lt;BR /&gt;thanks, you know someone could really learn alot from you guys.</description>
      <pubDate>Fri, 03 Aug 2001 17:33:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561493#M29428</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2001-08-03T17:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: rval of nslookup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561494#M29429</link>
      <description>Hi Kevin,&lt;BR /&gt;&lt;BR /&gt;I would say, all hp-ux commands which got internal menus ( like lanadmin, ftp, nslookup, rgy_edit, ...) have the same behaviour like what you discribe : Return exit 0 upon completion whether succeeded or not ( that's mean finshes with succes but don't mean the what it was doing is succeeded ! ).&lt;BR /&gt;&lt;BR /&gt;But usual hp-ux commands ( not divisible commands ) behave like what you supposed initially. If a command no not succeed what it is intended to do so the return code will be different from 0.&lt;BR /&gt;&lt;BR /&gt;Magdi</description>
      <pubDate>Mon, 06 Aug 2001 10:40:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rval-of-nslookup/m-p/2561494#M29429</guid>
      <dc:creator>Magdi KAMAL</dc:creator>
      <dc:date>2001-08-06T10:40:37Z</dc:date>
    </item>
  </channel>
</rss>

