11

bash completion issue

view full story
linux-howto

http://unix.stackexchange.com – I wrote two functions push and pull to copy files to and from a directory ($FILE_EXCHANGE_DIR). I want bash to autocomplete names from that directory when I use the pull function. I want the autocompletion to only take names from the said directory. In the current form, my autocompletion also finds names of the files in the current directory, regardless of whether there was a match in the source dir ($FILE_EXCHANGE_DIR) or not. Here are two versions of the function I passed to complete. Neither of them worked. _pull () { local cmd="${1##*/}"; local word=${COMP_WORDS[COMP_CWORD]}; (HowTos)