$? returns the exit value of previous command (that's where the 0 comes from). What exactly are you trying to do here:
Code:
if ( $?LD_LIBRARY_PATH ) then
export LD_LIBRARY_PATH=/home/hecrrc/CLHEP/lib:$LD_LIBRARY_PATH
else
export LD_LIBRARY_PATH=home/hecrrc/CLHEP/lib
fi
In addition you have to use [] in bash instead of (). You can test if string length is nonzero with [ ! -z "$VARIABLE" ], but you cannot use wildcards (like ?) in variable names (if that was what you tried to do?) As far as I can see, you could just use:
Code:
export LD_LIBRARY_PATH="/home/hecrrc/CLHEP/lib:$LD_LIBRARY_PATH"
There is no need for the whole if-then-else structure. It doesn't matter if LD_LIBRARY_PATH is previously unset.