#!/bin/ksh
if [ $# -lt 3 ]
then
echo Usage: $0 hostname directory filename
echo Note: make sure the machine,login,password has been existed in ${HOME}/.
netrc. For example:
echo
echo machine=zsups315
echo login=root
echo password=mypassword
exit 1
fi
hostname=$1
#get file list
file=`echo $* | awk '{ for (i = 3; i <= NF ; i++ ) printf("%s ",$i) }'`
directory=$2
# FTP file
ftp $hostname << EOF 2>&1
prompt off
bin
cd $directory
mput $file
EOF
ftp put
最新推荐文章于 2021-02-16 04:01:08 发布