From 206237c8ec4b7619d9e70a75004cd1ae1066b0a0 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sun, 25 Apr 1999 15:43:41 +0000 Subject: zsh-3.1.5-pws-16 --- Functions/Zftp/zfget_match | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Functions/Zftp/zfget_match (limited to 'Functions/Zftp/zfget_match') diff --git a/Functions/Zftp/zfget_match b/Functions/Zftp/zfget_match new file mode 100644 index 000000000..677108ede --- /dev/null +++ b/Functions/Zftp/zfget_match @@ -0,0 +1,27 @@ +# function zfget_match { + +emulate -L zsh + +# the zfcd hack: this may not be necessary here +if [[ $1 == $HOME || $1 == $HOME/* ]]; then + 1="~${1#$HOME}" +fi + +local tmpf=${TMPPREFIX}zfgm$$ + +if [[ $ZFTP_SYSTEM == UNIX* && $1 == */* ]]; then + # On the first argument to ls, we usually get away with a glob. + zftp ls "$1*$2" >$tmpf + reply=($(<$tmpf)) + rm -f $tmpf +else + if (( $#zftp_fcache == 0 )); then + # Always cache the current directory and use it + # even if the system is UNIX. + zftp ls >$tmpf + zftp_fcache=($(<$tmpf)) + rm -f $tmpf + fi + reply=($zftp_fcache); +fi +# } -- cgit 1.4.1