<?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: Return command in a shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/return-command-in-a-shell-script/m-p/2886696#M935520</link>
    <description>If you want to test return code in shell script, you can do:&lt;BR /&gt;&lt;BR /&gt;exit n ==&amp;gt; n is the number&lt;BR /&gt;&lt;BR /&gt;To test:&lt;BR /&gt;&lt;BR /&gt;if [[ $? = n ]]&lt;BR /&gt;then&lt;BR /&gt;  ...&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;This test can be done by other shell script.&lt;BR /&gt;</description>
    <pubDate>Tue, 21 Jan 2003 15:36:56 GMT</pubDate>
    <dc:creator>Julio Yamawaki</dc:creator>
    <dc:date>2003-01-21T15:36:56Z</dc:date>
    <item>
      <title>Return command in a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/return-command-in-a-shell-script/m-p/2886693#M935517</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Is there an equivalent command for the return command in HP world. I'm trying to debug compaq scripts to work on HP, but a return command doesn't work (it's normally going back in a loop and do some tests).&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;J??r??me&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Jan 2003 15:04:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/return-command-in-a-shell-script/m-p/2886693#M935517</guid>
      <dc:creator>Chartier Jerome</dc:creator>
      <dc:date>2003-01-21T15:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Return command in a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/return-command-in-a-shell-script/m-p/2886694#M935518</link>
      <description>I don't understand your question. HP's POSIX and Korn shells have the return command and it works as advertised. Normally it is used to return a function result but if used while not in a function then it is equivalent to an exit.&lt;BR /&gt;&lt;BR /&gt;What may be happening is that you are using a return in a sourced script&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;. myscript.sh&lt;BR /&gt;within a parent script. In this case, the sourced script becomes part of the parent process and a return is then an exit.&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Jan 2003 15:18:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/return-command-in-a-shell-script/m-p/2886694#M935518</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-01-21T15:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Return command in a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/return-command-in-a-shell-script/m-p/2886695#M935519</link>
      <description>Hi Jerome,&lt;BR /&gt;&lt;BR /&gt;If you put a return code after your exit statement at the end of your code, you should be able to get that return code you are looking for. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Jan 2003 15:25:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/return-command-in-a-shell-script/m-p/2886695#M935519</guid>
      <dc:creator>Marco Santerre</dc:creator>
      <dc:date>2003-01-21T15:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Return command in a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/return-command-in-a-shell-script/m-p/2886696#M935520</link>
      <description>If you want to test return code in shell script, you can do:&lt;BR /&gt;&lt;BR /&gt;exit n ==&amp;gt; n is the number&lt;BR /&gt;&lt;BR /&gt;To test:&lt;BR /&gt;&lt;BR /&gt;if [[ $? = n ]]&lt;BR /&gt;then&lt;BR /&gt;  ...&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;This test can be done by other shell script.&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Jan 2003 15:36:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/return-command-in-a-shell-script/m-p/2886696#M935520</guid>
      <dc:creator>Julio Yamawaki</dc:creator>
      <dc:date>2003-01-21T15:36:56Z</dc:date>
    </item>
  </channel>
</rss>

