我正在使用的库有一个脚本来设置适当的环境变量:
# Source this script to set up the ROOT build that this script is part of.
#
# Conveniently an alias like this can be defined in ~/.cshrc:
# alias thisroot "source bin/thisroot.sh"
#
# This script if for the csh like shells, see thisroot.sh for bash like shells.
#
# Author: Fons Rademakers, 18/8/2006
# $_ should be source .../thisroot.csh
set ARGS=($_)
set THIS="`dirname ${ARGS[2]}`"
setenv ROOTSYS "`(cd ${THIS}/..;pwd)`"
set path = ($ROOTSYS/bin $path)
if ($?LD_LIBRARY_PATH) then
setenv LD_LIBRARY_PATH $ROOTSYS/lib:$LD_LIBRARY_PATH # Linux, ELF HP-UX
else
setenv LD_LIBRARY_PATH $ROOTSYS/lib
endif
if ($?DYLD_LIBRARY_PATH) then
setenv DYLD_LIBRARY_PATH $ROOTSYS/lib:$DYLD_LIBRARY_PATH # Mac OS X
else
setenv DYLD_LIBRARY_PATH $ROOTSYS/lib
endif
if ($?SHLIB_PATH) then
setenv SHLIB_PATH $ROOTSYS/lib:$SHLIB_PATH # legacy HP-UX
else
setenv SHLIB_PATH $ROOTSYS/lib
endif
if ($?LIBPATH) then
setenv LIBPATH $ROOTSYS/lib:$LIBPATH # AIX
else
setenv LIBPATH $ROOTSYS/lib
endif
if ($?PYTHONPATH) then
setenv PYTHONPATH $ROOTSYS/lib:$PYTHONPATH
else
setenv PYTHONPATH $ROOTSYS/lib
endif
if ($?MANPATH) then
setenv MANPATH `dirname $ROOTSYS/man/man1`:$MANPATH
else
setenv MANPATH `dirname $ROOTSYS/man/man1`
endif
如果我在命令行中运行它,该脚本可以正常工作,例如
source /home/sm/packages/root/bin/thisroot.csh
但是,如果我尝试将该命令添加到我的 .cshrc 文件中,则会失败并显示错误消息:
ARGS: Subscript out of range.
是什么赋予了?