之前运用的是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