<?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: changing environment variables in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466656#M774562</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;What you need to do is put all your environment variables in to a file.&lt;BR /&gt;&lt;BR /&gt;For Eg:- &lt;BR /&gt;You have a set of variable for environment A in a file called "enva" and for environment B in a file called "envb"&lt;BR /&gt;&lt;BR /&gt;Upon selection by the user execute the environment file as follows:&lt;BR /&gt;.  envb   # ( remember to put a dot before the command with a space as given here )&lt;BR /&gt;&lt;BR /&gt;Above execution will set the variable in the current session.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Pramod&lt;BR /&gt;</description>
    <pubDate>Wed, 22 Nov 2000 16:14:03 GMT</pubDate>
    <dc:creator>Pramod_4</dc:creator>
    <dc:date>2000-11-22T16:14:03Z</dc:date>
    <item>
      <title>changing environment variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466654#M774560</link>
      <description>I need to make it easy for my users to change from one version of Quantum to another.  To do this, I have set up a script to change the $QTHOME variable, but when the script exits, the variable has reverted back to the default set up on login.  How can I get this change to take?</description>
      <pubDate>Wed, 22 Nov 2000 16:05:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466654#M774560</guid>
      <dc:creator>Jim Mickens</dc:creator>
      <dc:date>2000-11-22T16:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: changing environment variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466655#M774561</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;An environment variable is known in the current script and the child scripts if it's been exported.&lt;BR /&gt;&lt;BR /&gt;If you vant the calling script to maintain the value of a variable exported in a child, you should "source" the child script.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;in csh:&lt;BR /&gt;source my_script&lt;BR /&gt;in bourne, korn or posix shells&lt;BR /&gt;. my_script&lt;BR /&gt;(&lt;DOT&gt;&lt;SPACE&gt;my_script)&lt;BR /&gt;&lt;BR /&gt;This forces reading all variables in the currently executing shell&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;Dan&lt;BR /&gt;&lt;/SPACE&gt;&lt;/DOT&gt;</description>
      <pubDate>Wed, 22 Nov 2000 16:11:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466655#M774561</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2000-11-22T16:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: changing environment variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466656#M774562</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;What you need to do is put all your environment variables in to a file.&lt;BR /&gt;&lt;BR /&gt;For Eg:- &lt;BR /&gt;You have a set of variable for environment A in a file called "enva" and for environment B in a file called "envb"&lt;BR /&gt;&lt;BR /&gt;Upon selection by the user execute the environment file as follows:&lt;BR /&gt;.  envb   # ( remember to put a dot before the command with a space as given here )&lt;BR /&gt;&lt;BR /&gt;Above execution will set the variable in the current session.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Pramod&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Nov 2000 16:14:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466656#M774562</guid>
      <dc:creator>Pramod_4</dc:creator>
      <dc:date>2000-11-22T16:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: changing environment variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466657#M774563</link>
      <description>Jim:&lt;BR /&gt;&lt;BR /&gt;If you want the environment to remain, you have to "dot" the script ie.&lt;BR /&gt;&lt;BR /&gt;# . /path/to/script&lt;BR /&gt;&lt;BR /&gt;what this does is that it reads the script and executes it within the current shell without spawning a new process to execute it.  &lt;BR /&gt;&lt;BR /&gt;The parent process (ie. the shell) cannot be modified by a child process - you can only do it by "exec'ing" or "dot"ing  the script.</description>
      <pubDate>Wed, 22 Nov 2000 16:14:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466657#M774563</guid>
      <dc:creator>Kofi ARTHIABAH</dc:creator>
      <dc:date>2000-11-22T16:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: changing environment variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466658#M774564</link>
      <description>you could use the alias function&lt;BR /&gt;&lt;BR /&gt;alias env1="QTHOME=&lt;DIR1&gt;"&lt;BR /&gt;alias env2="QTHOME=&lt;DIR2&gt;"&lt;BR /&gt;&lt;BR /&gt;insert these lines into /etc/profile or $HOME/.profile&lt;/DIR2&gt;&lt;/DIR1&gt;</description>
      <pubDate>Wed, 22 Nov 2000 20:20:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466658#M774564</guid>
      <dc:creator>Rainer_1</dc:creator>
      <dc:date>2000-11-22T20:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: changing environment variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466659#M774565</link>
      <description>you could use the alias function&lt;BR /&gt;&lt;BR /&gt;alias env1="QTHOME=&lt;DIR1&gt;"&lt;BR /&gt;alias env2="QTHOME=&lt;DIR2&gt;"&lt;BR /&gt;&lt;BR /&gt;insert these lines into /etc/profile or $HOME/.profile&lt;BR /&gt;&lt;BR /&gt;then you be able to change QTHOME with simply entering&lt;BR /&gt;&lt;BR /&gt;env1&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;env2&lt;/DIR2&gt;&lt;/DIR1&gt;</description>
      <pubDate>Wed, 22 Nov 2000 20:20:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466659#M774565</guid>
      <dc:creator>Rainer_1</dc:creator>
      <dc:date>2000-11-22T20:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: changing environment variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466660#M774566</link>
      <description>I've tried all your suggestions, and still can't get it to work.  &lt;BR /&gt;&lt;BR /&gt;Some more details:&lt;BR /&gt;The $QTHOME variable is set with the setenv command in the logins to /opt/qtime/qt/v5e.5c. &lt;BR /&gt;I wanted them to switch to the new version to test, which means they need to set $QTHOME to /opt/qtime/qt/v5.7.  If they run changeqver.sh, it asks them which version they want to run, and does a setenv to the appropriate $QTHOME.  &lt;BR /&gt;&lt;BR /&gt;I've put the setenv commands into a separate file, and have changed the changeqver.sh to source the appropriate file, but it still doesn't work.  Using a . setqver just gives me a permission denied message (permission denied /opt/pd/.)&lt;BR /&gt;&lt;BR /&gt;All users are using the csh.</description>
      <pubDate>Wed, 22 Nov 2000 20:55:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466660#M774566</guid>
      <dc:creator>Jim Mickens</dc:creator>
      <dc:date>2000-11-22T20:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: changing environment variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466661#M774567</link>
      <description>Jim:&lt;BR /&gt;&lt;BR /&gt;its changeqver.sh that you should source&lt;BR /&gt;&lt;BR /&gt;csh# source /path/to/changeqver.sh&lt;BR /&gt;&lt;BR /&gt;I just tried it and it worked...</description>
      <pubDate>Wed, 22 Nov 2000 21:07:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466661#M774567</guid>
      <dc:creator>Kofi ARTHIABAH</dc:creator>
      <dc:date>2000-11-22T21:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: changing environment variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466662#M774568</link>
      <description>to make it much comfortabe use alias as&lt;BR /&gt;&lt;BR /&gt;alias changeqver "source changeqver.sh"&lt;BR /&gt;&lt;BR /&gt;add this line into /etc/csh.login or $HOME/.login&lt;BR /&gt;so the usesr only have to type changeqver and get their correct variable.</description>
      <pubDate>Thu, 23 Nov 2000 10:04:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466662#M774568</guid>
      <dc:creator>Rainer_1</dc:creator>
      <dc:date>2000-11-23T10:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: changing environment variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466663#M774569</link>
      <description>Hi Jim,&lt;BR /&gt;&lt;BR /&gt;I said it previously, if you are using csh, you should source the script file containing the variable definitions.&lt;BR /&gt;&lt;BR /&gt;example:&lt;BR /&gt;source changeqver.sh&lt;BR /&gt;&lt;BR /&gt;or, as Rainer suggested, use an alias&lt;BR /&gt;alias changeqver "source changeqver.sh" &lt;BR /&gt;&lt;BR /&gt;Make sure that in changeqver.sh, all variables are defined using the csh syntax for environment variables, ie 'setenv my_var value'&lt;BR /&gt;&lt;BR /&gt;This has been working for ages, there's no reason for not working in your scripts.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Dan&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Nov 2000 12:18:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466663#M774569</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2000-11-23T12:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: changing environment variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466664#M774570</link>
      <description>Sourcing the changeqver.sh worked.  I thought that sourcing a separate script that did the actual setenv command from inside the changeqver.sh would do the trick , but it didn't.  Thanks to all for your help.&lt;BR /&gt;&lt;BR /&gt;Jim</description>
      <pubDate>Mon, 27 Nov 2000 12:50:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-environment-variables/m-p/2466664#M774570</guid>
      <dc:creator>Jim Mickens</dc:creator>
      <dc:date>2000-11-27T12:50:33Z</dc:date>
    </item>
  </channel>
</rss>

