add to /etc/bash_completion.d/gentoo and source /etc/bash_completion to be used with http://kumba.drachentekh.net/service _service() { local cur prev COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $( compgen -W "$(for i in /etc/init.d/*; do echo ${i##*/}; done)" $cur ) ) elif [ $COMP_CWORD -eq 2 ]; then COMPREPLY=( $( compgen -W "start stop restart pause zap ineed needsme iuse usesme broken status" $cur ) ) fi } complete -o default -F _service service