2

During my login to my Linux environment via ssh the .cshrc file in my home directory is not read. Each time I had to read this file after login via source ~/.cshrc

I use MobaXTerm Professional 10.5 as a tool and my shell is a tcsh shell which I can confirm via

echo $SHELL
/bin/tcsh

I already tried to add files like .login and .tcshrc to source the .cshrc file, but nothing helped.

How can I enable reading the .cshrc file via ssh login?

Frank
  • 121
  • 1
  • 2

2 Answers2

2

There are multiple files parsed by this shell:

/etc/csh.cshrc
/etc/csh.login
~/.tcshrc
~/.cshrc
~/.login

The two firsts are system wide. The tree others are user related.

Maybe there is something wrong in your syntaxe. Try a simple file ~/.tcshrc containing:

echo "test"

It should output "test" before the prompt like this:

workstation:~ user$ cat ~/.tcshrc 
echo "test"
workstation:~ user$ /bin/tcsh 
test
[workstation:~] user%

Same output on remote with the following command: ssh -t user@workstation tcsh

Kevin Lemaire
  • 1,629
  • 1
  • 12
  • 28
  • 1
    And of the three user related files, `.tcshrc` is only read if it exists, and `.cshrc` is only read if it exists and `.tcshrc` **does not**. `.login` is only read on login shells. – Tim Kennedy Jan 23 '18 at 19:35
0

Make sure csh is actually running!

Run which csh to get location of csh.

Run ls -l /path/returned/by/which/csh

In my case, somehow csh was mapped to tcsh.

user3731622
  • 157
  • 1
  • 7