set lib_path_=$LD_LIBRARY_PATH
if ($?lib_path_n) then
else
  set lib_path_n=$LD_LIBRARY_PATH
endif
set lib_path_b=/afs/psi.ch/project/sinq/tru64/lib/fit_beta:$lib_path_n
set lib_path_o=/afs/psi.ch/project/sinq/tru64/lib/fit_old:$lib_path_n

echo " "
setenv LD_LIBRARY_PATH $lib_path_n
if ("$lib_path_" == "$lib_path_n") then
  fitvers "* Normal version"
else
  fitvers "  Normal version"
endif
setenv LD_LIBRARY_PATH $lib_path_b
if ("$lib_path_" == "$lib_path_b") then
  fitvers "* Beta version"
else
  fitvers "  Beta version"
endif
setenv LD_LIBRARY_PATH $lib_path_o
if ("$lib_path_" == "$lib_path_o") then
  fitvers "* Old version"
else
  fitvers "  Old version"
endif
setenv LD_LIBRARY_PATH $lib_path_
echo " "
if ("$1" == "") then
  echo "Select version (n,b,o)"
  set v=$<
  echo " "
else
  set v="$1"
endif
if ($v == "n") then
  setenv LD_LIBRARY_PATH $lib_path_n
  echo "Normal version selected"
else
  if ($v == "b") then
    setenv LD_LIBRARY_PATH $lib_path_b
    echo "Beta version selected"
  else
    if ($v == "o") then
      setenv LD_LIBRARY_PATH $lib_path_o
      echo "Old version selected"
    else
      echo "Version not changed"
    endif
  endif
endif
