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



## mrjayviper (Apr 29, 2016)

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!


----------



## SirDice (Apr 29, 2016)

Wrong syntax. It's 

```
setenv mystuff /home/userhere/myveryveryveryverylongfoldername
```


----------



## mrjayviper (Apr 30, 2016)

SirDice said:


> Wrong syntax. It's
> snip...



I am surprised the syntax when using /root/.cshrc is different. Thanks again.


----------



## SirDice (May 2, 2016)

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.


----------



## mrjayviper (May 2, 2016)

SirDice said:


> 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`.


----------



## SirDice (May 2, 2016)

Yes, but there's a difference with "inheritance" (for lack of a better word):

```
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
```


----------



## mrjayviper (May 2, 2016)

Thanks very much for the explanation.


----------

