Setting environment variables permanently.

Florian Diesch diesch at spamfence.net
Wed Mar 24 04:30:56 UTC 2010


Ray Parrish <crp at cmc.net> writes:

> I am a little confused on the use of environment variables in Ubuntu. In 
> windows I would simply set the variables value in the autoexec.bat file, 
> and it would be available for use. I have been reading the man pages, 
> and info pages for export, and env, and the following session has resulted.
>
> Hmmm, not persistent after the -p with export, and not persistent 
> between bash sessions either. How do I set an environment variable which 
> will always be available when I start a bash session, or run a bash script?

Use
 export some_var=some_value
in your ~/.bashrc


   Florian
-- 
<http://www.florian-diesch.de/grundgesetz.html>




More information about the ubuntu-users mailing list