我正在尝试将某些.bash_profile转换为兼容或在tcsh环境中运行。以下是我想翻译/转换的内容:
# Define the IDL base path
# Note: I actually source a setup routine that defines these, but if they
# are not found, I have the IF statement below to handle that
export IDL_LOC ; IDL_LOC=/Applications/itt/idl
export IDL_DIR ; IDL_DIR=/Applications/itt/idl71
unset IDL_PATH
if [ ${IDL_DIR:-0} != 0 ] ; then
export IDL_PATH ; IDL_PATH=$IDL_DIR
## Make sure to recursively search subdirectories
IDL_PATH=${IDL_PATH}:$(find $IDL_DIR -type d | tr '\n' ':' | sed 's/:$//')
## Add my directories (extra routines that you probably won't need)
IDL_PATH=$IDL_PATH:+.:+$HOME/example/directory/one
else
export IDL_PATH ; IDL_PATH=:+.:+/example/directory/two:+$HOME/example/directory/one
fi
################################################################################
# Set up a function
function themis {
# unset the IDL_PATH to avoid potential conflicts... (kludgy, I know)
unset IDL_PATH
# Define the TDAS path
export EXAMPLE_PATH_1=/example/directory/three
# source the setup IDL file
source ${IDL_LOC}/bin/idl_setup.bash
# source the another setup paths
source $EXAMPLE_PATH_1/example/directory/four/setup_file.bash
# start IDL (i.e., a programming language environment)
idl
# redefine defaults upon exit from IDL
source $HOME/.bash_profile
}
我对setenv与出口之间的区别并不是很困惑,因为我正在执行一些事情。例如:
1)我可以单独保留递归搜索语法(即find命令)吗?
2)如何将目录连接到tcsh中已定义的环境变量?
3)连接是否与bash相同?
4)我可以从tcsh中获取bash文件吗?
5)如果函数可以转换为别名,那么我如何将各种命令分开以便所有命令按顺序执行?
6)是否有相同的。 tcsh中的命令(即当前工作目录)
非常感谢任何帮助。