Unix path 

Value 

The $PATH environment in tcsh is strange:

set (will yield)

path   (. /home/cstudent/034897s/bin /usr/local/bin /usr/local/sbin /bin
/usr/sbin /usr/ud/bin /usr/openwin/bin /usr/ccs/bin /usr/ucb
/usr/local/lib/xlisp /usr/local/agenttcl/bin /usr/bin/nsr /usr/sbin/nsr
/usr/opt/SUNWmd/sbin)

env (will yield)

PATH=.:/home/cstudent/034897s/bin:/usr/local/bin:/usr/local/sbin:/bin:/usr/sbin
:/usr/ud/bin:/usr/openwin/bin:/usr/ccs/bin:/usr/ucb:/usr/local/lib/xlisp:/usr/
local/agenttcl/bin:/usr/bin/nsr:/usr/sbin/nsr:/usr/opt/SUNWmd/sbin

Set 

To set: set path = ( . ~/bin $path ) set cdpath = ($cdpath ~/ass )

To set perminately: add above 2 lines to .login

if you try setenv PATH=$PATH":"~/ttt to set the real $PATH, you'll find unix creats a new PATH in env for you, with the name the same as PATH and it's content the same as you sepcified. Original PATH not touched!

Use 

The usage of $PATH environment var in tcsh is strange:

Commands in path are search one time only at login. I.e., if you add some program to ~/bin, unix can not find it unless you quit and login again. — *N*:, use rehash. <<:Fri 05-28-99:>>

Amend 

"set path" vs "setenv PATH" 

"set path" without "setenv PATH" will only set the local "set" variable for tcsh, not the environment variable that can be sensed by sub-tasks.

"setenv PATH" 

It should be working ok. The previous test has syntax error. The correct form is:

setenv PATH $PATH":"~/ttt

or

setenv PATH ${PATH}:~/ttt

documented on: Sat 11-07-98 10:57:58