Guest User

Untitled

a guest
Oct 19th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. export files=`ls /home/tests/`
  2. complete -o filenames -W "${files}" xtest
  3.  
  4. _xtest () { .
  5. local cur
  6. local files=`ls /home/tests`
  7. COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]}
  8.  
  9. #case "$cur" in
  10.  
  11. COMPREPLY=( $(compgen -W "${files}" -- ${cur}) )
  12. # esac
  13. return 0
  14. }
  15.  
  16. complete -F _xtest -o filenames xtest
Add Comment
Please, Sign In to add comment