source ~/.bashrc 명령을 실행할 때 오류가 발생했습니다.

source ~/.bashrc 명령을 실행할 때 오류가 발생했습니다.
/home/my-pc/.bashrc:16: command not found: shopt
/home/my-pc/.bashrc:24: command not found: shopt
/home/my-pc/.bashrc:111: 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:314: parse error near `\n'
\[\e]0;\u@\h: \w\a\]\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ 

이것이 출력이다

답변1

이는 Linux의 기본 셸이 zsh로 설정되어 있고 다음 명령을 사용할 수 있도록 변경되었기 때문에 발생합니다.

chsh -s /bin/bash

그런 다음 bash 파일을 소싱하여 해당 파일에 있는 경로를 내보냅니다.

source ~/.bashrc

답변2

~/.zshrc쉘이 zsh인 경우 .bashrc 대신 편집하십시오 .

완료되면 :wq(vim을 사용한다고 가정)를 사용하여 파일을 저장하고 다음 명령을 실행합니다.

source ~/.zshrc

.bashrc에 대한 변경 사항을 모두 제거하여 두 번 실행되지 않도록 하세요.

관련 정보