# A simple bash completion for the service(8) command, as snipped from the # manpage of the same name __service() { local cur cur=${COMP_WORDS[COMP_CWORD]} COMPREPLY=( $( compgen -W '$( service -l )' -- $cur ) ) return 0 } complete -F __service service