<?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: set Path in script not working in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455343#M12307</link>
    <description>When the script is finished the shell the script was run in is also finished, that's my understanding of why you can type echo $PATH and not see /home after the script is run. Have it open a shell at the end of your script to see what I mean.&lt;BR /&gt;&lt;BR /&gt;Add /sbin/sh to end of script then type echo $PATH, type exit to close the shell and finish script.</description>
    <pubDate>Thu, 19 Oct 2000 01:01:46 GMT</pubDate>
    <dc:creator>Denver Osborn</dc:creator>
    <dc:date>2000-10-19T01:01:46Z</dc:date>
    <item>
      <title>set Path in script not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455342#M12306</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have a simple yet fustrating problem in executing a set PATH command in my script.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;PATH=/home:$PATH&lt;BR /&gt;export PATH&lt;BR /&gt;echo $PATH&lt;BR /&gt;&lt;BR /&gt;the echo $PATH is for the purpose of debugging.&lt;BR /&gt;When I run the script, the echo statement reflect that /home is added to the PATH.&lt;BR /&gt;But once, the script is finished executing when I did an echo $PATH at the commandline, the /home isn't in the PATH.&lt;BR /&gt;&lt;BR /&gt;Can anyone kindly help?&lt;BR /&gt;&lt;BR /&gt;Thanks a million.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Han Ming&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Oct 2000 00:40:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455342#M12306</guid>
      <dc:creator>Low Han Ming</dc:creator>
      <dc:date>2000-10-19T00:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: set Path in script not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455343#M12307</link>
      <description>When the script is finished the shell the script was run in is also finished, that's my understanding of why you can type echo $PATH and not see /home after the script is run. Have it open a shell at the end of your script to see what I mean.&lt;BR /&gt;&lt;BR /&gt;Add /sbin/sh to end of script then type echo $PATH, type exit to close the shell and finish script.</description>
      <pubDate>Thu, 19 Oct 2000 01:01:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455343#M12307</guid>
      <dc:creator>Denver Osborn</dc:creator>
      <dc:date>2000-10-19T01:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: set Path in script not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455344#M12308</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Your script executes in its own environment.  While this environment includes your shell's variables it is destroyed upon exit.  The PATH variable is treated as a local variable (i.e. not global) when referenced by your script.  Stated differently, your script gets a copy of the global variable.  The behavior you describe is expected.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 19 Oct 2000 01:20:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455344#M12308</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-10-19T01:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: set Path in script not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455345#M12309</link>
      <description>Thanks.&lt;BR /&gt;&lt;BR /&gt;In this case, how do I set the global variable.&lt;BR /&gt;&lt;BR /&gt;Thanks again for the advice.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Han Ming</description>
      <pubDate>Thu, 19 Oct 2000 01:29:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455345#M12309</guid>
      <dc:creator>Low Han Ming_1</dc:creator>
      <dc:date>2000-10-19T01:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: set Path in script not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455346#M12310</link>
      <description>Hi Han Ming &lt;BR /&gt;&lt;BR /&gt;If you want the variable setting be valid in you current shell, you need to put a dot before the script name . e.g. &lt;BR /&gt;#. script.sh &lt;BR /&gt;&lt;BR /&gt;the dot tells the shell to source the environment variable setting inside the script to be the global variable of the current shell.</description>
      <pubDate>Thu, 19 Oct 2000 02:05:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455346#M12310</guid>
      <dc:creator>Tk Lau</dc:creator>
      <dc:date>2000-10-19T02:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: set Path in script not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455347#M12311</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for all the help.&lt;BR /&gt;&lt;BR /&gt;I guess it has solved my problem totally.&lt;BR /&gt;&lt;BR /&gt;Thanks very much once again.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Han Ming</description>
      <pubDate>Thu, 19 Oct 2000 02:40:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455347#M12311</guid>
      <dc:creator>Low Han Ming</dc:creator>
      <dc:date>2000-10-19T02:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: set Path in script not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455348#M12312</link>
      <description>I believe the export of the PATH variable is only for subsequent shell environments.  If you exit the script/shell program you are reverting back to the previous environment where /home was not part of the the PATH variable.  So by setting the PATH variable in the script it would be available to other scripts or programs called by the script but not available to the parent script.&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Oct 2000 19:27:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-path-in-script-not-working/m-p/2455348#M12312</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2000-10-20T19:27:19Z</dc:date>
    </item>
  </channel>
</rss>

