Shell sftp下载文件

#!/bin/sh
##########################################
# sftp download file
# create by maxj
# 2017/02/06
##########################################

if [ $# != 5 ];then
    echo "usage:[ftpIp:$1 user:$2 ftppwd:$3 ftpDir:$4 localDir:$5]"
    exit -1
fi

ftpIp=$1
ftpUser=$2
ftpPwd=$3
ftpDir=$4
localDir=$5

#if [ -f $4 ];
#then
#   echo "no such file or directory"
#fi

sftp $2@$1 <$4 $5
quit
EOF

你可能感兴趣的:(Shell)