<?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 modifying calling environment from ksh script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510103#M894504</link>
    <description>at the end of a ksh script I went to set the directory that the user will be in after the script ends.&lt;BR /&gt;&lt;BR /&gt;I can cd to the directory but when the script ends it reverts to the calling environment. I could source the script rather than execute but that is not acceptable. The user will never remember to source it.&lt;BR /&gt;&lt;BR /&gt;Is there any way I can affect the calling environment from within a ksh script?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;henry, hwollman@moody.edu</description>
    <pubDate>Tue, 27 Mar 2001 18:36:19 GMT</pubDate>
    <dc:creator>Ben Spencer</dc:creator>
    <dc:date>2001-03-27T18:36:19Z</dc:date>
    <item>
      <title>modifying calling environment from ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510103#M894504</link>
      <description>at the end of a ksh script I went to set the directory that the user will be in after the script ends.&lt;BR /&gt;&lt;BR /&gt;I can cd to the directory but when the script ends it reverts to the calling environment. I could source the script rather than execute but that is not acceptable. The user will never remember to source it.&lt;BR /&gt;&lt;BR /&gt;Is there any way I can affect the calling environment from within a ksh script?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;henry, hwollman@moody.edu</description>
      <pubDate>Tue, 27 Mar 2001 18:36:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510103#M894504</guid>
      <dc:creator>Ben Spencer</dc:creator>
      <dc:date>2001-03-27T18:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: modifying calling environment from ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510104#M894505</link>
      <description>You have to source the script to get it to work, but you could make an alias for the script like:&lt;BR /&gt;alias script='. script'&lt;BR /&gt;&lt;BR /&gt;Good luck&lt;BR /&gt;Jesper</description>
      <pubDate>Tue, 27 Mar 2001 18:50:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510104#M894505</guid>
      <dc:creator>Jesper Sivertsen</dc:creator>
      <dc:date>2001-03-27T18:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: modifying calling environment from ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510105#M894506</link>
      <description>Try to use a dot script.&lt;BR /&gt;&lt;BR /&gt;Here's an example.&lt;BR /&gt;1) Create a script myfile ( in your home directory )&lt;BR /&gt;# vi myfile&lt;BR /&gt;root=/&lt;BR /&gt;cd $root&lt;BR /&gt;echo "hello"&lt;BR /&gt;2) Run the script&lt;BR /&gt;# . myscript&lt;BR /&gt;3) check your present dir&lt;BR /&gt;# pwd&lt;BR /&gt;/&lt;BR /&gt;4) You should be in the root directory now.&lt;BR /&gt;&lt;BR /&gt;------ fnhalili</description>
      <pubDate>Tue, 27 Mar 2001 18:59:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510105#M894506</guid>
      <dc:creator>f. halili</dc:creator>
      <dc:date>2001-03-27T18:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: modifying calling environment from ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510106#M894507</link>
      <description>Not what I wanted to hear, but if the only way to do it is the dot command then I am stuck.&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 27 Mar 2001 21:39:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510106#M894507</guid>
      <dc:creator>Ben Spencer</dc:creator>
      <dc:date>2001-03-27T21:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: modifying calling environment from ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510107#M894508</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sorry, but Jesper is right.  You will have to source the script.  An alias is probably your best bet.  Remember, if the user is running the C shell, the command is&lt;BR /&gt;&lt;BR /&gt;source script&lt;BR /&gt;&lt;BR /&gt;and not the "dot".&lt;BR /&gt;&lt;BR /&gt;--Bruce</description>
      <pubDate>Wed, 28 Mar 2001 02:01:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510107#M894508</guid>
      <dc:creator>Bruce Regittko_1</dc:creator>
      <dc:date>2001-03-28T02:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: modifying calling environment from ksh script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510108#M894509</link>
      <description>When you execute a program from shell it forkes a new process and it can take the environment variables from parent but viceversa is not possible and that is why when you come out of the child shell you loose all setting  for child shell. So the only way is to source it with a . command.&lt;BR /&gt;&lt;BR /&gt;Eg. #. &amp;lt;Script-name&amp;gt;</description>
      <pubDate>Wed, 28 Mar 2001 14:12:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/modifying-calling-environment-from-ksh-script/m-p/2510108#M894509</guid>
      <dc:creator>Rajeev Tyagi</dc:creator>
      <dc:date>2001-03-28T14:12:44Z</dc:date>
    </item>
  </channel>
</rss>

