<?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 PATH variable and batch in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/path-variable-and-batch/m-p/4958606#M100935</link>
    <description>On HP-UX 11i -&lt;BR /&gt;&lt;BR /&gt;If i type PATH=opt/wotever:$PATH, the path changes. I can confirm this using echo $PATH.&lt;BR /&gt;If i execute a batch file, usingg the same command, it does not work, the PATH remains the same.&lt;BR /&gt;What am I missing???????????&lt;BR /&gt;&lt;BR /&gt;TIA Ian</description>
    <pubDate>Thu, 09 Feb 2006 10:24:04 GMT</pubDate>
    <dc:creator>Ian Warner</dc:creator>
    <dc:date>2006-02-09T10:24:04Z</dc:date>
    <item>
      <title>PATH variable and batch</title>
      <link>https://community.hpe.com/t5/operating-system-linux/path-variable-and-batch/m-p/4958606#M100935</link>
      <description>On HP-UX 11i -&lt;BR /&gt;&lt;BR /&gt;If i type PATH=opt/wotever:$PATH, the path changes. I can confirm this using echo $PATH.&lt;BR /&gt;If i execute a batch file, usingg the same command, it does not work, the PATH remains the same.&lt;BR /&gt;What am I missing???????????&lt;BR /&gt;&lt;BR /&gt;TIA Ian</description>
      <pubDate>Thu, 09 Feb 2006 10:24:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/path-variable-and-batch/m-p/4958606#M100935</guid>
      <dc:creator>Ian Warner</dc:creator>
      <dc:date>2006-02-09T10:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: PATH variable and batch</title>
      <link>https://community.hpe.com/t5/operating-system-linux/path-variable-and-batch/m-p/4958607#M100936</link>
      <description>Hi Ian, &lt;BR /&gt;&lt;BR /&gt;I think, you have export with full path not relative. When you execute a script or batch file, it spawns a shell and export PATH to that particular child shell, when it finishes execution, PATH will be no longer available to parent. &lt;BR /&gt;&lt;BR /&gt;Hope this is clear. &lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Thu, 09 Feb 2006 10:34:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/path-variable-and-batch/m-p/4958607#M100936</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-02-09T10:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: PATH variable and batch</title>
      <link>https://community.hpe.com/t5/operating-system-linux/path-variable-and-batch/m-p/4958608#M100937</link>
      <description>It looks like you failed to export the variable&lt;BR /&gt;&lt;BR /&gt;PATH=/opt/wotever:${PATH}&lt;BR /&gt;export PATH &lt;BR /&gt;&lt;BR /&gt;or combine in 1 statement:&lt;BR /&gt;export PATH=/opt/wotever:${PATH}&lt;BR /&gt;&lt;BR /&gt;I assume the missing leading "/" before "opt" was a typo. &lt;BR /&gt;</description>
      <pubDate>Thu, 09 Feb 2006 10:35:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/path-variable-and-batch/m-p/4958608#M100937</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-02-09T10:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: PATH variable and batch</title>
      <link>https://community.hpe.com/t5/operating-system-linux/path-variable-and-batch/m-p/4958609#M100938</link>
      <description>A search found the answer in an earlier question.&lt;BR /&gt;&lt;BR /&gt;Ta.</description>
      <pubDate>Thu, 09 Feb 2006 10:39:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/path-variable-and-batch/m-p/4958609#M100938</guid>
      <dc:creator>Ian Warner</dc:creator>
      <dc:date>2006-02-09T10:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: PATH variable and batch</title>
      <link>https://community.hpe.com/t5/operating-system-linux/path-variable-and-batch/m-p/4958610#M100939</link>
      <description>Oh, you may be failing UNIX 101. If you set PATH in a child process then the child's environment can never be inherited by the parent.&lt;BR /&gt;&lt;BR /&gt;I'll assume that you are setting PATH in something like myvars.sh&lt;BR /&gt;&lt;BR /&gt;echo "Before: ${PATH}"&lt;BR /&gt;myvars.sh&lt;BR /&gt;echo "After : ${PATH}" # these will be the same&lt;BR /&gt;&lt;BR /&gt;The "trick" is to source your script via the "dot" operator so that it becomes a part of the current process.&lt;BR /&gt;echo "Before: ${PATH}"&lt;BR /&gt;. myvars.sh&lt;BR /&gt;echo "After : ${PATH}" # these will different&lt;BR /&gt;&lt;BR /&gt;When myvars.sh is sourced it must not contain an exit or return statement because now you will exit the foreground process.</description>
      <pubDate>Thu, 09 Feb 2006 10:41:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/path-variable-and-batch/m-p/4958610#M100939</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-02-09T10:41:01Z</dc:date>
    </item>
  </channel>
</rss>

