set CLASSPATH in CSH

January 5, 2010 at 05:06:13
Specs: Solaris 5.10, intel p4 1024 Mb ram
I am trying to add all jar files in a directory in a csh script using;
foreach file (${LISO_HOME}/*.jar)
    if (! -d $file) then
		if ($?CLASSPATH) then
			echo "CLASSPATH-1 $file:${CLASSPATH}"
			setenv CLASSPATH $file:${CLASSPATH}
		else
			echo "CLASSPATH-0 $file"
			setenv CLASSPATH $file
		endif
    endif
end
But I get "Variable Syntax". What am I doing wrong??

See More: set CLASSPATH in CSH

Report •

#1
January 11, 2010 at 01:16:53
I found the solution to my problem!!!!

The CLASSPATH variable needs to be the first argument as in

setenv CLASSPATH ${CLASSPATH}:$file

Thats very strange becase; this doesn't allow you to prepend the CLASSPATH but only append to it.

Anyways, It works for me.


Report •
Related Solutions


Ask Question