<?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: Dynamically Change Environment Variable in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019680#M428255</link>
    <description>Use:&lt;BR /&gt;&lt;BR /&gt;BUD=/oravol/u3/dbbackup_$ORACLE_SID/backups&lt;BR /&gt;&lt;BR /&gt;No parens.</description>
    <pubDate>Tue, 19 Dec 2006 11:12:08 GMT</pubDate>
    <dc:creator>Michael Steele_2</dc:creator>
    <dc:date>2006-12-19T11:12:08Z</dc:date>
    <item>
      <title>Dynamically Change Environment Variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019679#M428254</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;In the Korn Shell, is there a method to dynamically change an environment variable based on another variable's changing?&lt;BR /&gt;&lt;BR /&gt;I'm trying to use this:&lt;BR /&gt;&lt;BR /&gt;BUD=/oravol/u3/dbbackup_${ORACLE_SID}/backups&lt;BR /&gt;export BUD&lt;BR /&gt;&lt;BR /&gt;Where BUD would change values if ORACLE_SID changed.  i.e. BUD needs to be re-evaluated each time it is referenced.&lt;BR /&gt;&lt;BR /&gt;The single quotes make this happen for the PS1 environment variable:&lt;BR /&gt;&lt;BR /&gt;PS1='${MYHOST} ${PWD} $ '&lt;BR /&gt;export PS1&lt;BR /&gt;&lt;BR /&gt;I suspect that is a special case.&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;TIA,&lt;BR /&gt;Tom&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Dec 2006 11:00:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019679#M428254</guid>
      <dc:creator>Tom Dawson</dc:creator>
      <dc:date>2006-12-19T11:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change Environment Variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019680#M428255</link>
      <description>Use:&lt;BR /&gt;&lt;BR /&gt;BUD=/oravol/u3/dbbackup_$ORACLE_SID/backups&lt;BR /&gt;&lt;BR /&gt;No parens.</description>
      <pubDate>Tue, 19 Dec 2006 11:12:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019680#M428255</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2006-12-19T11:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change Environment Variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019681#M428256</link>
      <description>Hi Tom:&lt;BR /&gt;&lt;BR /&gt;You can do something like the following.  I'll use the shell's SECONDS variable in this example:&lt;BR /&gt;&lt;BR /&gt;# BUD='echo /oravol/u3/dbbackup_${SECONDS}/backups'&lt;BR /&gt;&lt;BR /&gt;# eval ${BUD}&lt;BR /&gt;&lt;BR /&gt;Those are single quotes in the variable assignent.  Every time the 'eval' is executed, the current number of seconds (since the shell began executing) is displayed.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 19 Dec 2006 12:26:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019681#M428256</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-12-19T12:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change Environment Variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019682#M428257</link>
      <description>Michael,&lt;BR /&gt;&lt;BR /&gt;Thanks.  But that's what I had been trying and it didn't work.&lt;BR /&gt;&lt;BR /&gt;James,&lt;BR /&gt;&lt;BR /&gt;Thanks, that works.  The "eval" could be a little cumbersome for our developers.  I'm going to leave the Bunny off for a while to see if I can get any other suggestions.&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Tom&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Dec 2006 13:01:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019682#M428257</guid>
      <dc:creator>Tom Dawson</dc:creator>
      <dc:date>2006-12-19T13:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change Environment Variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019683#M428258</link>
      <description>Hi Tom:&lt;BR /&gt;&lt;BR /&gt;To be clear, it is best to get in the habit of using curly braces when doing parameter substitution!&lt;BR /&gt;&lt;BR /&gt;Consider:&lt;BR /&gt;&lt;BR /&gt;# VAR=tom&lt;BR /&gt;# echo $VAR_was_here &lt;BR /&gt;sh: VAR_was_here: Parameter not set.&lt;BR /&gt;&lt;BR /&gt;Now:&lt;BR /&gt;&lt;BR /&gt;# VAR=tom&lt;BR /&gt;# echo ${VAR}_was_here&lt;BR /&gt;tom_was_here&lt;BR /&gt;&lt;BR /&gt;As noted in the manpages for 'sh-posix', "Braces are required when parameter is followed by a letter, digit, or underscore that should not be interpreted as part of its name or when a named parameter is subscripted."&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 19 Dec 2006 13:21:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019683#M428258</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-12-19T13:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change Environment Variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019684#M428259</link>
      <description>James,&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Yea, I almost always use the curley braces.  I find myself forgetting occaisionally, but I've been doing that for 10 - 15 years.&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Tom&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Dec 2006 19:04:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019684#M428259</guid>
      <dc:creator>Tom Dawson</dc:creator>
      <dc:date>2006-12-19T19:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change Environment Variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019685#M428260</link>
      <description>Hi Tom:&lt;BR /&gt;&lt;BR /&gt;My pointer regarding the use of curly braces was based upon the fact that you gave apparent credence to dropping them as a potential solution to your original query.  The use of curly braces in parameter substitution is a very valuable habit to develop, in my opinion.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 19 Dec 2006 20:34:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dynamically-change-environment-variable/m-p/5019685#M428260</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-12-19T20:34:37Z</dc:date>
    </item>
  </channel>
</rss>

