<?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: How to return variable to parent shell? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529945#M701466</link>
    <description>sorry, I've mistaken&lt;BR /&gt;everything works&lt;BR /&gt;thank you!</description>
    <pubDate>Fri, 22 Apr 2005 00:26:08 GMT</pubDate>
    <dc:creator>Igor Sovin</dc:creator>
    <dc:date>2005-04-22T00:26:08Z</dc:date>
    <item>
      <title>How to return variable to parent shell?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529941#M701462</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;My problem is the following&lt;BR /&gt;For example I do&lt;BR /&gt;#sh&lt;BR /&gt;#a=1&lt;BR /&gt;#echo $a&lt;BR /&gt;1&lt;BR /&gt;#exit&lt;BR /&gt;#echo $a&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;How to get value of variable "a" in my parent shell?&lt;BR /&gt;&lt;BR /&gt;thanx</description>
      <pubDate>Fri, 22 Apr 2005 00:13:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529941#M701462</guid>
      <dc:creator>Igor Sovin</dc:creator>
      <dc:date>2005-04-22T00:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to return variable to parent shell?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529942#M701463</link>
      <description>exit $a&lt;BR /&gt;&lt;BR /&gt;- Biswajit&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Apr 2005 00:17:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529942#M701463</guid>
      <dc:creator>Biswajit Tripathy</dc:creator>
      <dc:date>2005-04-22T00:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to return variable to parent shell?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529943#M701464</link>
      <description>I tried that&lt;BR /&gt;it doesn't work</description>
      <pubDate>Fri, 22 Apr 2005 00:21:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529943#M701464</guid>
      <dc:creator>Igor Sovin</dc:creator>
      <dc:date>2005-04-22T00:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to return variable to parent shell?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529944#M701465</link>
      <description>My last post will basically return value of $a to the&lt;BR /&gt;parent shell, so "echo $?" in parent shell after&lt;BR /&gt;execution would give the value of a (i.e 1 in your&lt;BR /&gt;example).&lt;BR /&gt;&lt;BR /&gt;I'm not sure if that what you asked. If you want to&lt;BR /&gt;set the variable a in the parent shell, then that can't&lt;BR /&gt;be done. You can't set a parameter to some value&lt;BR /&gt;automatically in the parent shell. You can only set a&lt;BR /&gt;variable to a value in a child shell by using "export a".&lt;BR /&gt;&lt;BR /&gt;- Biswajit&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Apr 2005 00:22:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529944#M701465</guid>
      <dc:creator>Biswajit Tripathy</dc:creator>
      <dc:date>2005-04-22T00:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to return variable to parent shell?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529945#M701466</link>
      <description>sorry, I've mistaken&lt;BR /&gt;everything works&lt;BR /&gt;thank you!</description>
      <pubDate>Fri, 22 Apr 2005 00:26:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529945#M701466</guid>
      <dc:creator>Igor Sovin</dc:creator>
      <dc:date>2005-04-22T00:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to return variable to parent shell?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529946#M701467</link>
      <description>See the following thread on the topic:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=14148" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=14148&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;- Biswajit&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Apr 2005 00:26:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529946#M701467</guid>
      <dc:creator>Biswajit Tripathy</dc:creator>
      <dc:date>2005-04-22T00:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to return variable to parent shell?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529947#M701468</link>
      <description>The thread mentioned only discusses using a temp file to store the value.  This is a tried and true and good way to do it.  However, you then have the little temp file housekeeping to contend with -- delete it , etc.&lt;BR /&gt; &lt;BR /&gt;For simple cases and depending on what you're doing, you don't need a file. Simply use Command Substitution.&lt;BR /&gt; &lt;BR /&gt;In the following, in the local shell, we're setting xx to the standard output of the execution of a child shell.  The child shell does some testing and then echoes (to standard out) various values depending on the results of his tests.  The parent shell (our shell) can then check the value of xx:&lt;BR /&gt; &lt;BR /&gt;Pine3 ## touch /tmp/foo ;\&lt;BR /&gt;xx=$(&lt;BR /&gt;if [ -f /tmp/foo ]&lt;BR /&gt;then echo 'foo_exists'&lt;BR /&gt;else echo 'foo_gone'&lt;BR /&gt;fi&lt;BR /&gt;);\&lt;BR /&gt;if [ "$xx" = 'foo_exists' ]&lt;BR /&gt;then echo "\n**it's all good!**"&lt;BR /&gt;else echo "\n**crap! where's foo?**"&lt;BR /&gt;fi&lt;BR /&gt; &lt;BR /&gt;**it's all good!**&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;Pine3 ## rm /tmp/foo ;\&lt;BR /&gt;xx=$(&lt;BR /&gt;if [ -f /tmp/foo ]&lt;BR /&gt;then echo 'foo_exists'&lt;BR /&gt;else echo 'foo_gone'&lt;BR /&gt;fi&lt;BR /&gt;);\&lt;BR /&gt;if [ "$xx" = 'foo_exists' ]&lt;BR /&gt;then echo "\n**it's all good!**"&lt;BR /&gt;else echo "\n**crap! where's foo?**"&lt;BR /&gt;fi&lt;BR /&gt; &lt;BR /&gt;**where's foo?**&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt;bv</description>
      <pubDate>Sun, 24 Apr 2005 09:05:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-return-variable-to-parent-shell/m-p/3529947#M701468</guid>
      <dc:creator>Bob_Vance</dc:creator>
      <dc:date>2005-04-24T09:05:45Z</dc:date>
    </item>
  </channel>
</rss>

