LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 02-27-2003, 11:22 PM   #1
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Rep: Reputation: 30
Reinitialising environment variable without restart the machine


Dear all,

how to reinitialising the environment variable after some alteration have made without restart to machine?
there are many shell command that will do this?
if so, pls show me how?
thanks in advance
 
Old 02-28-2003, 12:07 AM   #2
skidhmor
Member
 
Registered: Feb 2003
Location: Maitland, FL, USA
Distribution: Gentoo
Posts: 38

Rep: Reputation: 15
Logout of your shell by typing: logout
Then log back in. If your booting into X, then logout of your xsession, and log back in.
 
Old 02-28-2003, 12:12 AM   #3
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
are there many commands that will one go reinitialize the whole environment without logout and logout?
 
Old 02-28-2003, 02:06 AM   #4
doublefailure
Member
 
Registered: Mar 2002
Location: ma
Distribution: slackware
Posts: 747

Rep: Reputation: 30
export AVARIABLE=aValue

then u r set.

if u changed your .profile [.bash_profile]
u can do ". .profile"

it works for console that u typed that in.

good luck.
 
Old 02-28-2003, 02:15 AM   #5
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
if i created a new environment variables in /etc/profile then how to reinitialise them without logout and login the system.
are there any commands that will settle the reinitialising variables?
 
Old 02-28-2003, 04:40 AM   #6
mhearn
Guru
 
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 47
Define "reinitialise" please.

Do you mean, set them back to the factory defaults?
Or do you mean, how to make your changes take effect in all your shells/programs etc at once.
 
Old 02-28-2003, 05:57 PM   #7
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
i would rather define my "reinitialise" as make my changes to take effect in all shells at once. i found that this is quite troublesome to do the logout and logout in order to make thing works. what i am looking for is just a simple shell prompt that will make any changes (i.e. creating new environment variables) to take effect, just as what the effect of after logout and login does. are there shell prompt that will do this kind of favour?
Thanks for helps.
 
Old 02-28-2003, 11:07 PM   #8
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Ok, let me see if I understand this. You have multiple shells open. You make changes to some environment variables (either changing the values or creating new variables). Then you want all of your shells to reflect the new settings. Is that right?

Short answer: To my knowledge, no, there is no single command to update all open shells at once.

Long answer:
1) If you changed these environment variable values in one of your shell files (~/.bashrc, ~/.bash_profile, ~/.cshrc, or whatever), then you can re-source the file. For instance:
source ~/.bash_profile
-or-
. ~/bash_profile

However, that will only update the shell you execute the command in. You will have to re-source the file in every other shell you have open for the changes to take effect. Similarly, you can source the global files in the same way ("source /etc/profile").

2) If you made these changes from the command line, then there's no way to transfer them except by typing them in to the other shells.
 
  


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
xmms environment variable help Chomper Linux - Newbie 3 10-19-2005 11:23 PM
environment variable gamor Linux - Newbie 4 04-30-2005 05:28 PM
Environment Variable salmanucit Linux - Software 2 07-21-2004 02:27 AM
environment variable mimi Linux - Newbie 1 04-10-2002 08:29 AM
environment variable mimi Linux - General 2 04-10-2002 07:45 AM


All times are GMT -5. The time now is 01:42 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration