<?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: environment variable is not set when executing script.. in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/environment-variable-is-not-set-when-executing-script/m-p/4713733#M59283</link>
    <description>Hello.&lt;BR /&gt;&lt;BR /&gt;Source the script if you want to do this:&lt;BR /&gt;&lt;BR /&gt;source sid1.ksh&lt;BR /&gt;&lt;BR /&gt;(using ". sid1.ksh" has the same effect).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Goran</description>
    <pubDate>Tue, 16 Nov 2010 07:30:39 GMT</pubDate>
    <dc:creator>Goran Koruga</dc:creator>
    <dc:date>2010-11-16T07:30:39Z</dc:date>
    <item>
      <title>environment variable is not set when executing script..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/environment-variable-is-not-set-when-executing-script/m-p/4713732#M59282</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;i am executing script .script executed successfully. but environment variable is not set...&lt;BR /&gt;&lt;BR /&gt;Sript:&lt;BR /&gt;sid1.sh&lt;BR /&gt;&lt;BR /&gt;code:&lt;BR /&gt;&lt;BR /&gt;output:&lt;BR /&gt;&lt;BR /&gt;[oracle@test1 shell]$ sh sid1.ksh&lt;BR /&gt;&lt;BR /&gt;********************************************************************************&lt;BR /&gt; The current ORACLE_SID value is   testdb&lt;BR /&gt;********************************************************************************&lt;BR /&gt; The following are valid instance names along with the ORACLE_HOME value:&lt;BR /&gt;&lt;BR /&gt;1 : bingo&lt;BR /&gt;2 : +ASM&lt;BR /&gt;3 : star&lt;BR /&gt;&lt;BR /&gt;********************************************************************************&lt;BR /&gt;&lt;BR /&gt; Do you want to change ORACLE_SID  [Y/N]? \c&lt;BR /&gt;y&lt;BR /&gt;Enter Slno of the SID from above list  : \c&lt;BR /&gt;2&lt;BR /&gt;Oracle SID: +ASM&lt;BR /&gt;[oracle@test1 shell]$ echo $ORACLE_SID&lt;BR /&gt;testdb&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Nov 2010 07:09:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/environment-variable-is-not-set-when-executing-script/m-p/4713732#M59282</guid>
      <dc:creator>Friend_2</dc:creator>
      <dc:date>2010-11-16T07:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: environment variable is not set when executing script..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/environment-variable-is-not-set-when-executing-script/m-p/4713733#M59283</link>
      <description>Hello.&lt;BR /&gt;&lt;BR /&gt;Source the script if you want to do this:&lt;BR /&gt;&lt;BR /&gt;source sid1.ksh&lt;BR /&gt;&lt;BR /&gt;(using ". sid1.ksh" has the same effect).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Goran</description>
      <pubDate>Tue, 16 Nov 2010 07:30:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/environment-variable-is-not-set-when-executing-script/m-p/4713733#M59283</guid>
      <dc:creator>Goran Koruga</dc:creator>
      <dc:date>2010-11-16T07:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: environment variable is not set when executing script..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/environment-variable-is-not-set-when-executing-script/m-p/4713734#M59284</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] environment variable is not set...&lt;BR /&gt;&lt;BR /&gt;Actually, the environment variables _were_&lt;BR /&gt;set, but they were set in the wrong process.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [oracle@test1 shell]$ sh sid1.ksh&lt;BR /&gt;&amp;gt; [...]&lt;BR /&gt;&lt;BR /&gt;This runs a shell ("sh"), which runs the&lt;BR /&gt;shell script, which runs its own shell&lt;BR /&gt;("#!/bin/ksh"), and that "/bin/ksh" process&lt;BR /&gt;is where the environment variables were set.&lt;BR /&gt;When that process exits, its environment&lt;BR /&gt;(with the desired changes) disappears.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] ". sid1.ksh" [...]&lt;BR /&gt;&lt;BR /&gt;That causes the current shell to read the&lt;BR /&gt;commands in the file, so that when those&lt;BR /&gt;commands set environment variables, the&lt;BR /&gt;variables are set in the current shell's&lt;BR /&gt;environment, not in some (transient)&lt;BR /&gt;sub-shell's environment.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; #!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;A line like this serves no purpose here,&lt;BR /&gt;because this is not a complete shell script&lt;BR /&gt;-- the current shell must always read&lt;BR /&gt;("source") the file (". file").  (Thus, you&lt;BR /&gt;couldn't use the same file with a C shell.)</description>
      <pubDate>Wed, 17 Nov 2010 14:22:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/environment-variable-is-not-set-when-executing-script/m-p/4713734#M59284</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-11-17T14:22:18Z</dc:date>
    </item>
  </channel>
</rss>

