当我在Fedora机器上打开一个终端(或通过ssh进入)时,在出现提示之前,我会得到很多这样的信息:
declare -x CVS_RSH="ssh"
declare -x DISPLAY="localhost:10.0"
declare -x G_BROKEN_FILENAMES="1"
declare -x HISTSIZE="1000"
…
是什么原因造成的?编辑完之后,可能会发生这种情况.bashrc
,但是我相信我所做的只是将另一个目录路径添加到“ PATH =“。
更新(响应Heavyd的回答):我grep'ed ~/.bashrc
,~/.bash_profile
并/etc/bashrc
进行了“声明”,但未发现任何内容。
我查看是/etc/bashrc
因为~/.bashrc
包含以下内容:
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
除了上面的代码“ PATH =…”,“ export…”和“ alias…”之外,在~/.bashrc
或~/.bash_profile
脚本中没有任何其他内容。
当我运行.bashrc
脚本(使用“ bash ~/.bashrc
”)或.bash_profile
脚本时,我看到“声明”列表,但没有错误消息。(如果我跑步,我什么也看不到/etc/bashrc
。)
~./bash_profile
很简单:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
解决:谢谢andrew.n,您的建议帮助我进行了跟踪。事实证明,如果仅运行一个,就会输出所有那些“ declare -x…”行export
,而我不小心在自己的“ export”和“ PATH =…”之间插入了一个CR .bashrc
。