Environment variables

How can I set an environment variable permanently in openSUSE11.3?

? have you read the pointers in /etc/bash.bashrc?

PLEASE DO NOT CHANGE /etc/bash.bashrc There are chances that your changes

will be lost during system upgrades. Instead use /etc/bash.bashrc.local

for your local settings, favourite global aliases, VISUAL and EDITOR

variables, etc …

and in /etc/profile?

PLEASE DO NOT CHANGE /etc/profile. There are chances that your changes

will be lost during system upgrades. Instead use /etc/profile.local for

your local settings, favourite global aliases, VISUAL and EDITOR

variables, etc …

Add them to your ~/.bashrc init file. If you want the changes system-wide, look at JohnVV’s post.

Yes, I read it but the problem is that I have neither /etc/bash.bashrc.local nor /etc/profile.local :frowning:

It is up to you to create these files.

I don’t have that file :frowning:

BTW these files are meant for system wide settings. Users should define their variables in ~/.bashrc and/or ~/.profile.

echo “export EDITOR=vi” >> ~/.bashrc

Now you have it. :wink:

  • Yes I did replace “>” by “>>” … just in case you had one, so it won’t be overwritten.