diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-04-25 15:43:41 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-04-25 15:43:41 +0000 |
commit | 206237c8ec4b7619d9e70a75004cd1ae1066b0a0 (patch) | |
tree | ff703cbc295605f90755edb68672ed2de11f4a81 /Functions/Zftp/zftype | |
parent | 8ceb54fbc2f879e0e80f58c18761bd54db07e5f7 (diff) | |
download | zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.tar.gz zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.tar.xz zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.zip |
zsh-3.1.5-pws-16 zsh-3.1.5-pws-16-w6109 dot-zsh-199904280524
Diffstat (limited to 'Functions/Zftp/zftype')
-rw-r--r-- | Functions/Zftp/zftype | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Functions/Zftp/zftype b/Functions/Zftp/zftype new file mode 100644 index 000000000..c3b93b7a0 --- /dev/null +++ b/Functions/Zftp/zftype @@ -0,0 +1,30 @@ +# function zftype { +local type zftmp=${TMPPREFIX}zftype$$ + +zfautocheck -d + +if (( $# == 0 )); then + zftp type >$zftmp + type=$(<$zftmp) + rm -f $zftmp + if [[ $type = I ]]; then + print "Current type is image (binary)" + return 0 + elif [[ $type = A ]]; then + print "Current type is ASCII" + return 0 + else + return 1 + fi +else + if [[ $1 == (#i)a(sc(ii|)|) ]]; then + type=A + elif [[ $1 == (#i)i(m(age|)|) || $1 == (#i)b(in(ary|)|) ]]; then + type=I + else + print "Type not recognised: $1" 2>&1 + return 1 + fi + zftp type $type +fi +# } |