k8s/etc

k8s / _get_comp_words_by_ref: command not found 자동완성 에러

부엉이사장 2024. 9. 3. 03:41

https://eli-kim.tistory.com/entry/K8s-getcompwordsbyref-command-not-found-%ED%95%B4%EA%B2%B0

 

K8s, _get_comp_words_by_ref: command not found 해결

그냥 작업하면 잘되는데 kubectl에서는 tap을 누르면 아래와 같은 에러가 뜬다. _get_comp_words_by_ref: command not found 보통 bash-completion을 설치하지 않아서 생기는 문제이지만, 다른 때에는 잘 되다가 꼭 k

eli-kim.tistory.com

 

 

# 자동완성 세션 종료후에도 계속 적용되게 하기

vim ~/.bashrc

젤끝가서 (명령모드 G)

 

# Enable bash completion
if [ -f /etc/bash_completion ]; then
    source /etc/bash_completion
fi

# Enable kubectl completion
if command -v kubectl &> /dev/null; then
    source <(kubectl completion bash)
fi

이거 추가

source ~/.bashrc

적용