<?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: Embarrassingly simple env variable question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/embarrassingly-simple-env-variable-question/m-p/2756595#M71571</link>
    <description>Hi Doug,&lt;BR /&gt;&lt;BR /&gt;If you calling another file from your .profile, use this syntax,&lt;BR /&gt;&lt;BR /&gt;. /path_to_file/file_name&lt;BR /&gt;&lt;BR /&gt;Then do a check for the env variable,&lt;BR /&gt;&lt;BR /&gt;echo $SERVERNAME&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
    <pubDate>Tue, 02 Jul 2002 18:01:28 GMT</pubDate>
    <dc:creator>Sanjay_6</dc:creator>
    <dc:date>2002-07-02T18:01:28Z</dc:date>
    <item>
      <title>Embarrassingly simple env variable question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/embarrassingly-simple-env-variable-question/m-p/2756593#M71569</link>
      <description>I am a little embarrassed to post this...but here goes&lt;BR /&gt;&lt;BR /&gt;I have a script to change env variables but it is not working.  I believe it is set up identical to my .profiles, yet a check of the variable using echo indicates they are not changed.&lt;BR /&gt;&lt;BR /&gt;TESTSETTINGS=defaultconfig.test&lt;BR /&gt;export TESTSETTINGS&lt;BR /&gt;&lt;BR /&gt;SERVERNAME=HP9K_serv01&lt;BR /&gt;export SERVERNAME&lt;BR /&gt;&lt;BR /&gt;echo $ yields the original .profile settings.&lt;BR /&gt;&lt;BR /&gt;tia&lt;BR /&gt;Doug</description>
      <pubDate>Tue, 02 Jul 2002 17:55:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/embarrassingly-simple-env-variable-question/m-p/2756593#M71569</guid>
      <dc:creator>Doug_3</dc:creator>
      <dc:date>2002-07-02T17:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Embarrassingly simple env variable question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/embarrassingly-simple-env-variable-question/m-p/2756594#M71570</link>
      <description>Hi Doug,&lt;BR /&gt;&lt;BR /&gt; The env vars you set in the script are only available to the script or any children it spawns. They cannot be easily passed back to the parent - the shell that runs the script in your case.&lt;BR /&gt;Try echoing them inside the script to see their true value while in the script.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 02 Jul 2002 18:01:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/embarrassingly-simple-env-variable-question/m-p/2756594#M71570</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-07-02T18:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Embarrassingly simple env variable question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/embarrassingly-simple-env-variable-question/m-p/2756595#M71571</link>
      <description>Hi Doug,&lt;BR /&gt;&lt;BR /&gt;If you calling another file from your .profile, use this syntax,&lt;BR /&gt;&lt;BR /&gt;. /path_to_file/file_name&lt;BR /&gt;&lt;BR /&gt;Then do a check for the env variable,&lt;BR /&gt;&lt;BR /&gt;echo $SERVERNAME&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Jul 2002 18:01:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/embarrassingly-simple-env-variable-question/m-p/2756595#M71571</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2002-07-02T18:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Embarrassingly simple env variable question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/embarrassingly-simple-env-variable-question/m-p/2756596#M71572</link>
      <description>Hi Doug:&lt;BR /&gt;&lt;BR /&gt;Let me see if this is what you are doing.&lt;BR /&gt;Originally in your .profile&lt;BR /&gt;XXX=000&lt;BR /&gt;YYY=111&lt;BR /&gt;export XXX YYY&lt;BR /&gt;You created a script, env.sh that does this&lt;BR /&gt;XXX=888&lt;BR /&gt;YYY=999&lt;BR /&gt;export XXX YYY&lt;BR /&gt;&lt;BR /&gt;You then&lt;BR /&gt;env.sh&lt;BR /&gt;echo $XXX&lt;BR /&gt;and you see "000" rather than the expected "888".&lt;BR /&gt;&lt;BR /&gt;------------------------------------------&lt;BR /&gt;&lt;BR /&gt;There is nothing wrong with your code but you are trying to change the parent's env from a child; that dog won't hunt.&lt;BR /&gt;&lt;BR /&gt;What you can do is SOURCE env.sh.&lt;BR /&gt;. env.sh&lt;BR /&gt;&lt;BR /&gt;The '.' remains in the foreground and is part of the current shell. You must make certain that your sourced script does not contain an exit or return or you will of cource exit your current (foreground) process.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
      <pubDate>Tue, 02 Jul 2002 18:07:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/embarrassingly-simple-env-variable-question/m-p/2756596#M71572</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-07-02T18:07:30Z</dc:date>
    </item>
  </channel>
</rss>

