LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   setting environment variables (https://www.linuxquestions.org/questions/linux-newbie-8/setting-environment-variables-68592/)

durden2.0 06-27-2003 11:53 PM

setting environment variables
 
I am having trouble figuring out the right way to change or set an environment variable. For example, I want to change the $HISTSIZE variable from 1000 to 500. I keep trying to fix this but it always seems to go back and display 1000. How is the right way to set and change these variables from the command line? Thanks

Crashed_Again 06-28-2003 05:33 AM

Check out /etc/profile . If you set the HISTSIZE to 500 it will be 500 until you log out of that shell. Once you log back in, or open up another shell, it goes back to what /etc/profile says it should be. You can just change it in /etc/profile from 1000 to 500.

durden2.0 06-28-2003 03:04 PM

Ok that only works for root. Do I need to make a copy of that /etc/profile and name it like .profile in my home directory? Would that fix the variable for the regular user? Also I use bash so is there not already a file in the home directory I can change that variable in because I can't find one at all. Thanks for the help though!

Crashed_Again 06-28-2003 03:41 PM

If you change the value in /etc/profile then it will be system wide(i.e. for all users) If you want to do it for a specific user then add it into there .bashrc file like /home/user/.bashrc

durden2.0 06-28-2003 06:39 PM

Ok for some reason its not system wide after I changed /etc/profile its still only for root. Also how do I put that in ~/.bashrc? I have tried a bunch of different syntax and it never works always says like 1000=500 not valid or something to that effect. Thanks for the help this is driving me crazy haha!

eccles23 07-15-2003 01:57 PM

sounds like you might be putting

$HISTSIZE=1000

instead of HISTSIZE=1000
?

because if you put the first one it'd convert it to that variables current value and the end result would be 500=1000...

just a thought....


All times are GMT -5. The time now is 09:41 PM.