LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   .cshrc won't execute on login (https://www.linuxquestions.org/questions/linux-newbie-8/cshrc-won%27t-execute-on-login-4175512047/)

bulrush15 07-23-2014 11:58 AM

.cshrc won't execute on login
 
CentOS 7.0 which we just installed as a VM

I have root access to the VM, via putty and ssh.

When I login to csh, my .cshrc in /root doesn't execute. How do I get it to execute?

Thanks.

EDIT: Holy smokes! 5 minutes after posting this it was the top result in a Google search!

pan64 07-24-2014 06:59 AM

Are you really sure about that?
check your login shell, home dir settings, permissions and try to insert an echo "this is my .cshrc" into .cshrc.

bulrush15 07-24-2014 08:53 AM

Yes I'm sure, my aliases were not getting set. I had to put this in my $HOME .login file:

source .cshrc

Then it worked.

pan64 07-25-2014 12:16 AM

It depends on how csh was compiled, here is the official man page:
Quote:

A login shell begins by executing commands from the system files /etc/csh.cshrc and /etc/csh.login. It then executes commands from files in the user's home directory: first ~/.tcshrc (+) or, if ~/.tcshrc is not found, ~/.cshrc, then ~/.history (or the value of the histfile shell variable), then ~/.login, and finally ~/.cshdirs (or the value of the dirsfile shell variable) (+). The shell may read /etc/csh.login before instead of after /etc/csh.cshrc, and ~/.login before instead of after ~/.tcshrc or ~/.cshrc and ~/.history, if so compiled; see the version shell variable.


All times are GMT -5. The time now is 06:38 PM.