_stl_completions() { local stlfiles cur stlfiles=$(find . -type f -name "*.stl" 2>/dev/null \ | awk -F"./articles/" '{print $2}') cur="${COMP_WORDS[COMP_CWORD]}" COMPREPLY=( $(compgen -W "$stlfiles" -- ${cur}) ) return 0 } complete -F _stl_completions 'stl'