【发布时间】:2019-06-20 00:10:54
【问题描述】:
我在 Mac 上安装了 anaconda,我注意到它在我的 .profile 中附加了以下内容:
# added by Anaconda3 5.3.1 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
. "/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
我对“\eval”和“\export”行的转义感到有些困惑。这样做的目的是什么?我怀疑它与便携性有关,但我以前从未见过。
有人能解释一下它的用途吗?
【问题讨论】:
-
@Spencer:你是对的,我的问题确实是重复的。不幸的是,当您有问题时,搜索的内容并不总是很明显......