Bash completion from another completion
I have a script that requires as an argument the name of command and arguments of that command. So I want to write a completion function that would complete the name of the command and would complete the arguments for that command. So I can complete the name of the command like this if [[ "$COMP_CWORD" == 1 ]]; then COMPREPLY=( $( compgen -c ${COMP_WORDS[COMP_CWORD]} )) else #Don't know what to write here fi So this will complete the first argument to list of shell commands that are available to run. And on second and other arguments I need a completion for ${COMP_WORDS[COMP_CWORD]} command. I