_postconf () { local debut; COMPREPLY=(); debut=${COMP_WORDS[COMP_CWORD]}; COMPREPLY=($(postconf | cut -d' ' -f1 | grep ^$debut)); return 0; } complete -F _postconf postconf _rmmod () { local cur COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} COMPREPLY=($( lsmod | awk '{if (NR != 1 && $1 ~ /^'$cur'/) print $1}')) return 0 } complete -F _rmmod rmmod complete -f -X '!*.rpm' rpm