-bash: 400:: 터미널을 열 때 명령을 찾을 수 없습니다.

-bash: 400:: 터미널을 열 때 명령을 찾을 수 없습니다.

설치를 해보았습니다자식 완료.bash존재하다OSX터미널을 사용하세요. 이러한 편집 과정이
필요합니다 . 나는 그것을 사용했다 . 이 변경 후~/.bash_profile
vi ~/.bash_profile단말기알겠습니다 -bash: 400:: command not found. 하지만 다시 편집할 수는 없습니다!
그 외에도 나는다른bash_config 파일내 홈 디렉토리에 .bash_profile.swo & .bash_profile.swp.
누구든지 이 문제를 해결하는 방법을 알려줄 수 있나요?

이 내 꺼야 .bash_profile:

# Setting PATH for Python 3.4     # The orginal version is saved in .bash_profile.pysave   
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"    
export PATH      # Setting PATH for Python 3.5      # The orginal version is saved in .bash_profile.pysave    
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"    
export PATH      # added by Anaconda3 4.0.0 installer    
export PATH="//anaconda/bin:$PATH"      # added by Anaconda3 4.0.0 installer    
export PATH="/anaconda/anaconda/bin:$PATH"      # Setting PATH for Python 3.5      # The original version is saved in .bash_profile.pysave        
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"    
export PATH      # added by Anaconda3 4.1.1 installer    
export PATH="//anaconda/bin:$PATH"      # Setting PATH for Python 3.5      # The original version is saved in .bash_profile.pysave    
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"    
export PATH      # Setting PATH for Python 3.5      # The original version is saved in .bash_profile.pysave    
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"   
export PATH      # Setting PATH for Python 3.5     # The original version is saved in .bash_profile.pysave   
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"   
export PATH   
export LC_ALL=en_US.UTF-8   
export LANG=en_US.UTF-8     # added by Anaconda3 4.1.1 installer    
export PATH="/Users/shahramkarimi/anaconda/bin:$PATH"      # Setting PATH for Python 3.6      # The original version is saved in .bash_profile.pysave    
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"    
export PATH      # added by Anaconda3 4.3.1 installer    
export PATH="/Users/shahramkarimi/anaconda/bin:$PATH"      # added by Anaconda3 4.3.1 installer    
export PATH="/Users/shahramkarimi/anaconda/bin:$PATH"        # added by Anaconda3 4.4.0 installer    
export PATH="/Users/shahramkarimi/anaconda/bin:$PATH"      # added by Anaconda3 5.0.1 installer    
export PATH="/Users/shahramkarimi/anaconda3/bin:$PATH"      # Show always fullpath on terminal      #export PS1='\u@\H:\w$ '    
export PS1='\u \w$ '    
if [ -f ~/.git-completion.bash ]; then     
 . ~/.git-completion.bash   
fi

답변1

.bash_profile.swo파일은 .bash_profile.swpVim이 만든 임시 파일일 뿐입니다. 파일 은 편집할 때가 아니라 편집기에서 열 때 생성되며 .swp이미 존재합니다 ..bash_profile.swo.bash_profile.bash_profile.swp

~/.git-completion.bash오류가 있는 경우 , ~/.profile및 파일을 확인하세요 ~/etc/profile. 아마 줄이 있을거에요

400::

어딘가에서 Bash는 이것을 명령으로 해석합니다. 다음 명령으로 이를 확인할 수 있습니다.

grep -H 400 ~/.git-completion.bash ~/.profile ~/etc/profile

(제안해 주신 @terdon에게 감사의 말씀을 전하며 게시물을 편집했습니다.)

답변2

$ sudo -i
-bash: 400:: command not found

# ls -rt /etc/bash_completion.d/|tail -1
kubectl

# cat /etc/bash_completion.d/kubectl
400: Invalid request

손상된 bash 완료 파일( kubectl이 경우)로 인해 오류가 발생했습니다.

손상된 파일 삭제:

# rm /etc/bash_completion.d/kubectl
# exit
$ sudo -i

즐기다.

관련 정보