shell "FTP 自动接收用户名 密码"

#!/bin/sh
E_ARG=65
if [ -z "$1" ]
then
 echo "usage: `basename $0` filename to upload"
 exit $E_ARG
fi
filename=`basename $1`
server="ip address"
directory="/susan/shell"
password="root"
login="root"
ftp -n << EOF
open $server 21
user $login $password
prompt
binary
bell
cd $directory
put "$filename"
bye
EOF
exit 0

你可能感兴趣的:(shell,ftp,职场,休闲)