之前使用的是 bash,自从使用 zsh 后,在执行 source ~/.bashrc 的时候出现下面的 command not found 的错误。

下面是错误信息

/home/trsky/.bashrc:16: command not found: shopt
/home/trsky/.bashrc:33: command not found: shopt
/home/trsky/.bashrc:116: command not found: shopt
/usr/share/bash-completion/bash_completion:51: command not found: shopt
/usr/share/bash-completion/bash_completion:57: command not found: complete
/usr/share/bash-completion/bash_completion:62: command not found: complete
/usr/share/bash-completion/bash_completion:65: command not found: complete
/usr/share/bash-completion/bash_completion:68: command not found: complete
/usr/share/bash-completion/bash_completion:71: command not found: complete
/usr/share/bash-completion/bash_completion:74: command not found: complete
/usr/share/bash-completion/bash_completion:77: command not found: complete
/usr/share/bash-completion/bash_completion:80: command not found: complete
/usr/share/bash-completion/bash_completion:83: command not found: complete
/usr/share/bash-completion/bash_completion:86: command not found: complete
/usr/share/bash-completion/bash_completion:89: command not found: complete
/usr/share/bash-completion/bash_completion:92: command not found: complete
/usr/share/bash-completion/bash_completion:1996: parse error near `\n'


输出错误信息 


这里有个 stack overflow 的回应信息 
shopt command not found in .bashrc after shell updation 

解决 
博主在 linux 上利用 Anaconda 同时配置了多个版本的 python ,在修改了~/.bashrc 文件企图更改系统默认的 python 之后 ,在 zsh 上执行了 source ~/.bashrc 。很明显这是个错误的认识

好吧,正确的做法如下:

将所需配置修改写入~/.zshrc
执行 source ~/.zshrc
--------------------- 
作者:种子选手 
来源:CSDN 
原文:https://blog.csdn.net/qq_36148847/article/details/79261067 
版权声明:本文为博主原创文章,转载请附上博文链接!

Logo

更多推荐