create custom "variables" in /etc/csh.cshrc

Hello. I have some custom variables that are just shortcuts to specific folder locations.

set mystuff=/home/userhere/myveryveryveryverylongfoldername

If I placed this command inside /root/.cshrc, it works ok. but if I placed it inside /etc/csh.cshrc, it doesn't work.

I also tried changing the prompt by editing /etc/csh.cshrc and it also doesn't work.

According to this handbook entry, it should work fine.

Any ideas what I could be doing wrong? Thanks! :)
 
With csh (or tcsh) there's a difference between set and setenv. The first sets shell specific variables (like prompt), the second sets environment variables. Which I believe is what you're looking for.
 
With csh (or tcsh) there's a difference between set and setenv. The first sets shell specific variables (like prompt), the second sets environment variables. Which I believe is what you're looking for.

when I used /root/.cshrc, I can set environment variables using set.
 
Yes, but there's a difference with "inheritance" (for lack of a better word):
Code:
dice@molly:~ % set mytest1=blah
dice@molly:~ % setenv mytest2 blah
dice@molly:~ % tcsh
You have mail.
dice@molly:~ % echo $mytest1
mytest1: Undefined variable.
dice@molly:~ % echo $mytest2
blah
 
Back
Top