homebrewがインストールしたbashの完成は機能しません。

homebrewがインストールしたbashの完成は機能しません。

私はインストールしましたホームブリッジを介してbashを完了そして、次のコードを追加してください。.bash_profile

if [ -f $(brew --prefix)/etc/bash_completion ]; then
  . $(brew --prefix)/etc/bash_completion
fi

有効なbash完了スクリプトが多くても、Bash完了は機能しません。/usr/local/etc/bash_completion.d

$ ls /usr/local/etc/bash_completion.d
abook               mc
adb-completion.bash     mcrypt
ant             mdadm
apache2ctl          medusa
apt             minicom
apt-build           mkinitrd
aptitude            module-init-tools

bashプロンプトでbash完了を手動で実行すると、エラーが発生します。

$ [ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
-bash: .: /Users/hanxue/.bash_completion: is a directory
$ source /usr/local/etc/bash_completion
-bash: .: /Users/hanxue/.bash_completion: is a directory

ベストアンサー1

知ってみると私にも一つあるようだった~/.bash_completion 目次、bash完了スクリプトが期待する場合文書

ディレクトリを削除すると問題が解決し、bashの完成が機能します。

$ ls -ld ~/.bash_completion/
drwxr-xr-x  3 hanxue  staff  102 Oct  1  2013 /Users/hanxue/.bash_completion/
$ rm -R ~/.bash_completion
$ [ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion

見ているBash 完了ソースコード、この行を見つけました。

# source user completion file
[[ $BASH_COMPLETION != ~/.bash_completion && -r ~/.bash_completion ]] \
    && . ~/.bash_completion

おすすめ記事