Artificial intelligent assistant

How to bash-complete output of two arbitrary commands at the same time Here goes: function _command() { local cur COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} if [ "$COMP_CWORD" -ge "2" ]; then COMPREPLY=($( compgen -W '$(pwd)' -- "$cur" ) ) else COMPREPLY=($( compgen -W "arg1 arg2" -- "$cur" ) ) fi } complete -F _command command This works well, so long as I `source` it. What if I want it to auto-complete both outputs of `pwd` and some other arbitrary command, say `hostname`? What if I also wanted it to auto-complete on any file path?

Either


COMPREPLY=($(compgen -W '$(pwd)' -- "$cur") $(compgen -W '$(hostname)' -- "$cur"))


(you want a bigger array, just make one) or


COMPREPLY=($( compgen -W '$(pwd; hostname)' -- "$cur" ) )


(still autocompleting one command).

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 6d11e17cd20072790c4ff6dd0f3b810a