Click to See Complete Forum and Search --> : .cshrc
mfghazi
12-30-2000, 09:42 PM
I'm using C-shell. I've made some changes in the .cshrc file and when I typed "source .cshrc", the changes applied. But if I open another terminal or reboot the system, those changes does not apply. I've made the change /etc/passwd so that the root automatically goes into C-shell.
I've also used the variables like setenv. Do they also not apply each time. How changes can be applied automatically each time a terminal is opened.
------------------
Ghazi, Muhammad Farhan
Speedy
12-31-2000, 04:09 AM
All I know is that with bash you have a .bashrc and a .bash_profile? And .bashrc is for non-login shells and .bash_profile is for login shells. Might it be similar for csh? I don't have the man pages for csh on my system but you might try seeing if there is a man page for .cshrc and seeing if there is a .csh_profile or equivalent and giving that a shot. Thatnks for the trick with "source" by the way...I'll have to remember that...
-Speedy
Strike
12-31-2000, 07:13 AM
I forget what the global equivalent of /etc/profile is for C shell, but there is something in /etc that gets sourced everytime ANYONE logs in for C shell. Find that, and you are set.
And Speedy, we bash users are lazy. Sure, source works, but just typing . is ever so much faster.
. .bashrc or . .bash_profile
personally, I symlink the two together (I think .bashrc is the file, profile the link) - the differences are too small for me to have to make two changes.
mfghazi
01-01-2001, 10:30 PM
-Speedy
Please tell that what is this login shells and non-login shells? I didn't find .bash_profile neither anything similar for csh. There are no man pages for csh but only for bash.
-Strike
I think that /etc/profile is also for csh (as the path variables also apply in csh). There are two files in /etc (csh.cshrc and csh.login). Which file get sourced as you mentioned?
------------------
Ghazi, Muhammad Farhan
Strike
01-02-2001, 09:21 AM
Yes, the path variables may be the same, but the syntax for setting them changes with shell, so I think /etc/profile is bash/sh dependent (or any other shell that follows that syntax, I suppose). I mean..
export PATH=$PATH:/foo:/bar:/foo/bar
means nothing to csh, so it wouldn't make sense that it worked with csh as well as bash.
As far as those other two files are concerned, you've got me. They are probably about as different as .bashrc and .bash_profile. I'd just delete one and symlink it to the other, personally. But you may want to keep a backup.
Also, I think a "non-login" shell is like when you open up an xterm or something. I know that spawns a shell, but since you don't have to log in again, I figured it might be considered a "non-login' shell ... pretty bright, huh? http://www.linuxnewbie.org/ubb/biggrin.gif