Results 1 to 2 of 2
Whenever I set a custom environment variable in Bash, it doesn't exist when I exit the shell. I've tried just EXTRACT_DIRECTORY=/home/notroot/sources, set, export, typeset, declare (-x) and editing ~/.bashrc and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-28-2005 #1Linux Engineer
- Join Date
- Jan 2005
- Location
- Chicago (USA)
- Posts
- 1,028
Evil environment variables
Whenever I set a custom environment variable in Bash, it doesn't exist when I exit the shell. I've tried just EXTRACT_DIRECTORY=/home/notroot/sources, set, export, typeset, declare (-x) and editing ~/.bashrc and ~/.bash_profile.
- 05-28-2005 #2Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- Posts
- 796
If you set a variable, it will only last until that shell is exited. If you want to keep it, the best thing (if you're using bash) is to export it in you ~/.bashrc:
export MONKEY="cheese and cucumbers"
.bashrc is sourced whenever a bash shell is started, so the export will happen and the variable will be defined.


Reply With Quote
