# Thisroot.csh gives setenv error, unless included in the ~/.cshrc file

**URL:** <https://root-forum.cern.ch/t/thisroot-csh-gives-setenv-error-unless-included-in-the-cshrc-file/43567>\
**Category:** Newbie\
**Created:** [February 16, 2021, 9:39pm UTC](https://root-forum.cern.ch/t/thisroot-csh-gives-setenv-error-unless-included-in-the-cshrc-file/43567 "2021-02-16T21:39:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pauln](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@pauln](https://root-forum.cern.ch/u/pauln)\
**Post date:** [February 16, 2021, 9:39pm UTC](https://root-forum.cern.ch/t/thisroot-csh-gives-setenv-error-unless-included-in-the-cshrc-file/43567/1 "2021-02-16T21:39:28Z")

</div>

Hi,

I am trying to declutter my environment after hitting some issues. One such problem is with ROOT and Jupyter, where something was killing Jupyter Lab.

I previously had:  
``setenv ROOTSYS “/cern/root/v6.22.03g9/”` `  
in my .cshrc and this was fine. My idea was to move this (and other ROOT related/dependant environmental varables into a separate file, which I could source when I was going to launch root.  
However, when I do this I get a “setenv: Too many arguments.” error. I have narrowed this down to the thisroot.csh command.

Replacing the identical line back into the .cshrc resolves the issue.

What is going on here? Am I misunderstanding that I should be able to use this script out-with the .cshrc?

For reference my (reduced) .cshrc:  
`  
#!/bin/tcsh

if ( $?HOSTNAME == 0 ) setenv HOSTNAME `uname -n || hostname`

# 

# 

################## USER SECTION #############################################

# 

```
# PATH is a list of directories to search for executable files
setenv PATH "./:/bin:/usr/bin:/usr/local/bin"
setenv LD_LIBRARY_PATH "./:/usr/X11R6/lib:/usr/local/lib64"
setenv LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:/usr/local/lib:/usr/lib:/usr/lib64:/usr/local/java/latest/bin"

#root
#source /cern/root/v6.22.03g9/bin/thisroot.csh

setenv PATH "/usr/local/bin:${PATH}" #for gcc9 

setenv EDITOR nano

setenv COATJAVA /home/clas12/coatjava

#for Ananconda
#setenv ANACONDASYS /home/clas12/anaconda3
#setenv PATH "${PATH}:${ANACONDASYS}/bin"

setenv PATH "${PATH}:/w/work3/home/pauln/Miniconda/bin"

set autolist=ambiguous

####PATH additions
setenv PATH "${PATH}:/w/work3/home/pauln/TeXLive/2020/bin/x86_64-linux"

```

`  
The second file is reduced to only contain the line:

`  
#!/bin/tcsh

setenv ROOTSYS "/cern/root/v6.22.03g9/

source ${ROOTSYS}/bin/thisroot.csh  
`

Thanks in advanced for any help!

Cheers,  
Paul

_ROOT Version:_\_ 6.22.03  
_Platform:_ CentOS 7  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [February 17, 2021, 11:35am UTC](https://root-forum.cern.ch/t/thisroot-csh-gives-setenv-error-unless-included-in-the-cshrc-file/43567/2 "2021-02-17T11:35:04Z")

</div>

Hello,

So if I understand correctly, the issue is that when you separate the sourcing of thisroot.csh to a second file, and you source that file from the original one, you get an error?

---

<div class="post-metadata">

**Author:** ![pauln](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@pauln](https://root-forum.cern.ch/u/pauln)\
**Post date:** [February 10, 2023, 11:22am UTC](https://root-forum.cern.ch/t/thisroot-csh-gives-setenv-error-unless-included-in-the-cshrc-file/43567/3 "2023-02-10T11:22:03Z")

</div>

Sincerest apologies, I somehow missed the reply here all that time ago. I forget the exact solution, but it was an issue in the computing environment I was using.
