On Wed, 22 May 2002, C.H. Close wrote:

> Hi
> 
>       I am having a problem persuading Bash to accept a script to add some
> additional environment variable to a Konsole environment.
> 
> The script I am using simply adds some stuff to the PATH statement as
> well as some extra environment variables typically the file contains
> statements as follows.
> 
> 
>                       PATH=$VARKON_ROOT/bin:$PATH
>                       export PATH
> 
> In previous versions of UNIX I have used making the script file
> executable and running it resulted in the PATH (in this case) having the
> additional directory appended to it, this also worked for new
> environment variables. When I do the same thing in Linux in a Konsole
> terminal under KDE the environment does not change. As far as I can
> glean from reading the man page for Bash this should work. If I run the
> commands from the prompt everything works fine but of course this is
> tedious and should not be necessary.
> 
> Can anyone guide me as what I am doing wrong?

Most likely you're executing the script rather than sourcing it. E.g.,
doing:
  ./name_of_script

rather than:

  . ./name_of_script

By sourcing it, you run the script in the current shell rather than in a
subshell, whose environment is lost on exit.


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to