# Running basic commands in a normal user's .cshrc?



## mrjayviper (May 19, 2014)

Hello. I added a very simple command in a normal user's .cshrc (e.g. /home/my-user-here/.cshrc)


```
echo "I am here"
```

It just wouldn't work. If I do the same thing on the root user, it works fine. Any ideas what I could be doing wrong?

Basically my real aim is to automatically run `su` once I'm logged in using the normal user. And I'm using `echo` commands for now just as a test.

Thanks 

ps. I did try `su` at first but that didn't work so I then moved to testing using `echo` commands.


----------



## Toast (May 20, 2014)

If your shell is tcsh(), it will use ~/.tcshrc if it exists instead of ~/.cshrc.


----------



## SirDice (May 20, 2014)

Toast said:
			
		

> If your shell is tcsh(), it will use ~/.tcshrc instead of ~/.cshrc if it exists.


No, ~/.cshrc will get executed, even with tcsh(1). It's not common to use ~/.tcshrc.


```
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)  (+).
```


----------



## Toast (May 20, 2014)

SirDice said:
			
		

> No, ~/.cshrc will get executed, even with tcsh(1).


Edited my previous post as it was worded incorrectly. I meant to say: "If your using tcsh() and ~/.tcshrc exists it will be used instead of ~/.cshrc."



			
				SirDice said:
			
		

> It's not common to use ~/.tcshrc.


As uncommon as it may be, if it exists it would still override ~/.cshrc unless you had 
	
	



```
source ~/.cshrc
```
 in it.


----------

