# How to setenv on tcsh?



## dlarmour (Nov 16, 2003)

Hi

I want to add to my PATH.  I tried

setenv PATH=$PATH:/usr/bin

It tells me there is a "bad modifier (/).  Can someone help?

Thanx

David


----------



## Viro (Nov 17, 2003)

Get rid of the = symbol like so

setenv PATH $PATH:/usr/bin


----------



## quiksan (Nov 17, 2003)

Viro said:
			
		

> Get rid of the = symbol like so
> 
> setenv PATH $PATH:/usr/bin




i tried this as you stated, and got the same error as above.


----------



## hazmat (Nov 17, 2003)

Try:

set path=($path /usr/bin)


----------



## ericl (Nov 17, 2003)

setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/x11R6/bin"


----------



## naodx (Nov 17, 2003)

When I was using tcsh in jaguar this is the line I had:

setenv PATH /usr/X11R6/bin:/usr/local/bin:$PATH


----------



## MisterK (Nov 19, 2003)

well this always worked for me and still does:

set path = ( $path /usr/local/bin )   or whatever directory you wanna add. oh yea dont forget to rehash after you used this command.
Also if you want to make it permanent add it to your /.tcshrc file. Just open it (vi ~/.tcshrc or any other editor) then add the set path line, save the file, and rehash or open another terminal window. (this is for tcsh shell only for bash or sh it would be slightly diffrent)


----------



## lavixu (Aug 25, 2009)

Hey,
   I got the same error in my bash/csh shell.
 This is one of the solutions to it.
setenv PATH $PATH":$HOME/bin"


----------



## endrest (Sep 18, 2012)

lavixu said:


> Hey,
> I got the same error in my bash/csh shell.
> This is one of the solutions to it.
> setenv PATH $PATH":$HOME/bin"


This is the only solution.  This worked for me where no other string did.  The double quotes are the trick.


----------

