Script export problem in FC3

Markku Kolkka markkukolkka at kolumbus.fi
Tue Dec 21 23:25:49 UTC 2004


Samuel Díaz García kirjoitti viestissään (lähetysaika 
keskiviikko, 22. joulukuuta 2004 00:43):
> I need to modify the PATH environment using a script. My
> script is:
>
> --begin--
> #!bin/sh
> export PATH=$PATH:/mydir
> --end--
>
> If I run the export command in command line I have no problem,
> but when I run my script, and I run
>
> echo $PATH
>
> I can see that the path environtment variable isn't changed.
>
> What can be the problem?

The script is run in a new shell, and the export command has 
effect only in that shell and any commands started from it. You 
must use the "source" command to execute the script in the 
current shell.





More information about the fedora-list mailing list