function _ssh_connector_completion() { latest="${COMP_WORDS[$COMP_CWORD]}" words=$(grep -v -E "\#" $SSH_CONNECTOR_HOST_LIST | awk '{print $1}') COMPREPLY=($(compgen -W "$words" -- $latest)) return 0 } function _scp_path_completition() { latest="${COMP_WORDS[$COMP_CWORD]}" COMPREPLY=$(grep -v -E "\#" $SSH_CONNECTOR_HOST_LIST | awk '{print $1}') return 0 } complete -F _ssh_connector_completion ssh_helper complete -F _ssh_connector_completion scp_helper