
Bash-completion.el defines dynamic completion hooks for shell-mode and shell-command prompts that is based on bash completion.
Bash completion for Emacs:
* is aware of bash builtins, aliases and functions * does file expansion inside of colon-separated variables and after redirections (> or <) * escapes special characters when expanding file names * is configurable through programmable bash completion * works on remote shells, through TRAMP.