1

I want to do a custom bash completion. In the completion are "@"-signs and I don't know how to escape them. The completion works until the @ occurs and then stops the completion. I would be glad for some help.

_foo()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"

opts="jim@john go@alpha"

COMPREPLY=( $(compgen -W ${opts} -- ${cur}) )
}
complete -o nospace -F _foo foo
Aserre
  • 4,916
  • 5
  • 33
  • 56
Chris
  • 11
  • 1

0 Answers0