To enable autocomplete in Bash, you need to have the bash-completion package installed:
-
Ubuntu/Debian:
sudo apt install bash-completion
-
Arch Linux:
sudo pacman -S bash-completion
Get the script and save it in your personal directory:
mkdir -p ~/.rabbix
rabbix completion bash > ~/.rabbix/rabbix.bashAdd to your ~/.bashrc:
echo 'source ~/.rabbix/rabbix.bash' >> ~/.bashrcRestart the terminal or run:
source ~/.bashrcIn Zsh, autocomplete is more straightforward and doesn't require extra dependencies.
Add this line to the end of your ~/.zshrc:
autoload -U compinit; compinit
source <(rabbix completion zsh); compdef _rabbix rabbixRestart the terminal or run:
source ~/.zshrc