use*_*888 3 shell bash profile
我对丢失的文件运行了一个源命令。我忘记了,但后来注意到每次我打开一个新终端时,第一行都是关于丢失文件的警告
bash: /software/intel-composer-2011u5-x86_64/bin/compilervars.sh: No such file or directory
~ $
Run Code Online (Sandbox Code Playgroud)
我如何摆脱这个警告?
作为一般规则,像这样的奇怪错误是由于从 shell 读取的各种初始化文件之一调用了一个文件。哪一个取决于您使用的 shell 以及您如何启动它。
这是一个漂亮的函数,它将查看所有可能的bash
init 文件以及grep
它们以查找您正在寻找的任何内容。将这些行添加到您的~/.bashrc
:
grep_bash(){
for f in ~/.bashrc ~/.profile ~/.bash_profile ~/.bash_login \
/etc/profile /etc/bash.bashrc /etc/environment;
do
[ -e $f ] && grep -H HIST $f;
done
}
Run Code Online (Sandbox Code Playgroud)
您现在可以检查从哪个文件中调用丢失的文件:
$ grep_bash intel-composer-2011u5-x86_64
/home/terdon/.bashrc:source /software/intel-composer-2011u5-x86_64/bin/compilervars.sh
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1467 次 |
最近记录: |