> keys=$(gpg --list-keys |grep uid |sed 's/.*<\(.*\)>/\1/') > COMPREPLY+=($(compgen -W "${keys}" -- ${cur})) Apparently this tweaks out keys with spaces or keys w/o emails.