LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-27-2003, 11:53 PM   #1
durden2.0
Member
 
Registered: May 2003
Distribution: redhat 9.0
Posts: 113

Rep: Reputation: 15
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
 
Old 06-28-2003, 05:33 AM   #2
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
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.
 
Old 06-28-2003, 03:04 PM   #3
durden2.0
Member
 
Registered: May 2003
Distribution: redhat 9.0
Posts: 113

Original Poster
Rep: Reputation: 15
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!
 
Old 06-28-2003, 03:41 PM   #4
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
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
 
Old 06-28-2003, 06:39 PM   #5
durden2.0
Member
 
Registered: May 2003
Distribution: redhat 9.0
Posts: 113

Original Poster
Rep: Reputation: 15
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!
 
Old 07-15-2003, 01:57 PM   #6
eccles23
Member
 
Registered: Jun 2003
Location: Australia
Distribution: Gentoo/kernel 2.6.2
Posts: 45

Rep: Reputation: 15
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....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Environment variables setting... simjii SUSE / openSUSE 4 11-19-2005 07:50 PM
Setting Environment Variables rbh123 Linux - Newbie 2 10-03-2005 06:34 PM
Need help setting environment variables. cottonmouth Linux - Newbie 3 12-09-2004 04:54 PM
setting environment variables jayjoh Linux - Newbie 9 07-12-2004 12:35 PM
setting environment variables rezza Linux - Distributions 2 04-09-2003 08:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration