i92guboj |
03-27-2009 05:52 AM |
Quote:
Originally Posted by Paris Heng
(Post 3489362)
I also having the problems today, why the alteration never permanently store in the kernel? I wonder, export PATH=${PATH}:/blah/wrongdir, never store permanently?
|
I don't know what do you mean but environment variables have nothing to do with the kernel, not even with linux. They are parsed by the shell and have meaning only while you are inside a shell.
~/.bashrc and ~/.bash_profile just happen to be two of the the initialization files for bash, which is just one of the available shells. If you were using tcsh, zsh or ksh then they would be different.
It's the way that shells work, if you want something to be permanent you have to put it on their initialization files, bash doesn't save anything automatically, and I can't think of any other shell that does so.
About "export", well, it doesn't export anything in that sense that you probably though. "export" is just a keyword that tells bash that that variable should be marked as exportable, so it will be available for child processes in case they need it. If the variable is not exported, most child processes will not be able to see a variable that you set in the current shell. It doesn't save anything and it doesn't "export" anything to the config files either, if that's what you thought.
|