Results 1 to 6 of 6
hey, i tried several times to set permanent environment variable but i failed. everything i did was temp. can anyone tell me how can set permanent env-var?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-15-2005 #1Just Joined!
- Join Date
- Oct 2005
- Posts
- 5
set environment variable
hey, i tried several times to set permanent environment variable but i failed. everything i did was temp. can anyone tell me how can set permanent env-var?
- 12-15-2005 #2Just Joined!
- Join Date
- Nov 2005
- Location
- Somewhere inside my hard drive...
- Posts
- 24
Re: set environment variable
Try doing it from command line while logged in as root. BTW, what distro are you using?
Originally Posted by y2keyank
- 12-15-2005 #3
Nope.
Let's say that I want an environment variable called $HELLO, and it contains the value "Hola". I would do this by adding the following line to the ~/.bashrc file:
Basically, add them to ~/.bashrc, and they take effect whenever you login as that user.Code:HELLO=Hola
To make systemwide changes, do the same thing, but to the /etc/profile file.
- 12-15-2005 #4
Slackware used to have a profile directory somewhere in /etc. I assume that didn change. You can add scripts setting environment variables there. Those will be executed during boot.
I\'m so tired .....
#200472
- 12-17-2005 #5Just Joined!
- Join Date
- Oct 2005
- Posts
- 5
hey Cabhan,
i already know this but the problem is i don't know which part of the file should have this line?
(e.g) this is my ~/.bashrc
--------------------------------------------------
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
-----------------------------------------------
- 12-17-2005 #6Just add 'em right to the end.Code:
# .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi HELLO=Hola



