Visit Our UNIX and Linux User Community


how to unsetenv ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to unsetenv ?
# 1  
Old 11-25-2001
how to unsetenv ?

I executed the following lines twice (accidentally)

setenv JAVA_HOME=/usr/local/jdk1.1.8
setenv PATH $JAVA_HOME/bin:$PATH

I'm in the tcsh shell (freebsd 4.1.1)
When I do : echo $PATH it shows up like this:

/usr/local/jdk1.1.8=/bin /usr/local/jdk1.1.8=/bin

1 .How can I remove one of those ? ( I tried unsetenv, but I didn't succeed)

2. Why does it add a '=' in the path? Is this correct?
# 2  
Old 11-25-2001
When using setenv in csh, do not use =. The syntax is

setenv ENV_VAR value

where ENV_VAR is any environment variable you want to set (i.e. JAVA_HOME, etc.). I've always used set to set the PATH variable in csh. The syntax for set is

set PATH=( . . . )

That said, unsetenv should remove the environment variable from the shell environment completely. If you just want to reset the value, reissue the setenv command with the value you want to use for each environment variable.

Hope this helps.
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #330
Difficulty: Easy
The first dual-core CPU was the Intel Pentium D.
True or False?

Featured Tech Videos