daily pastebin goal
49%
SHARE
TWEET

geirha

a guest Mar 2nd, 2012 17 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. _filedir ()
  2. {
  3.     local IFS='
  4. ' xspec;
  5.     _expand || return 0;
  6.     local -a toks;
  7.     local tmp;
  8.     toks=(${toks[@]-} $(
  9.     compgen -d -- "$(quote_readline "$cur")" | {
  10.     while read -r tmp; do
  11.         echo $tmp
  12.     done
  13. }
  14. ));
  15.     if [[ "$1" != -d ]]; then
  16.         xspec=${1:+"!*.$1"};
  17.         toks=(${toks[@]-} $(
  18.     compgen -f -X "$xspec" -- "$(quote_readline "$cur")" | {
  19.     while read -r tmp; do
  20.         [ -n $tmp ] && echo $tmp
  21.     done
  22. }
  23. ));
  24.     fi;
  25.     COMPREPLY=("${COMPREPLY[@]}" "${toks[@]}")
  26. }
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top