How can I setup bash completion for the
unset command, like when you use
echo $XXX, you can get a completion for
You need to turn on bash's programmable completion system. There's a file called
bash_completion distributed with bash that you must include from your
.bashrc. On typical distributions, put this in
If this file is not present on your system, it may be in a separate package from the main bash executable, e.g.
bash-completion on Debian.
If you specifically want completion for the
unset command, that's
complete -v unset
On my Ubuntu/Bash system:
TM1=A; TM2=B unset TM<ESC><*> => unset TM1 TM2 (expands in the command line)