Mac - Installation du Bash completion
Alasta 3 Novembre 2015 mac bash Mac tools shell
Description : Voici comment installer le Bash Completion sous MacOS
Description :
Le Bash completion est très utile quand on utilise de manière régulière un shell Bash.
Pré-requis :
Comme nous allons installer le bash completion via Brew, il faut que ce dernier soit installé.
Personnellement je l’ai installé ce dernier via ce Gist.
Installation :
$ sudo brew install bash-completion
Password:
==> Downloading https://homebrew.bintray.com/bottles/bash-completion-1.3.el_capitan.bottle.1.tar.gz
######################################################################## 100,0%
==> Pouring bash-completion-1.3.el_capitan.bottle.1.tar.gz
==> Caveats
Add the following lines to your ~/.bash_profile:
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
Homebrew's own bash completion script has been installed to
/opt/homebrew/etc/bash_completion.d
Bash completion has been installed to:
/opt/homebrew/etc/bash_completion.d
==> Summary
🍺 /opt/homebrew/Cellar/bash-completion/1.3: 188 files, 1,1M
Comme indiqué, il faut ajouter les lignes suivantes à votre bash_profile :
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
Pour la prise en compte du fichier, il suffit d’ouvrir un nouveau terminal ou de sourcer le bash_profile :
$ source ~/.bash_profile