#!/bin/sh
E_ARG=65
if [ -z "$1" ]
then
echo "usage: `basename $0` filename to upload"
exit $E_ARG
fi
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"
login="root"
ftp -n << EOF
open $server 21
user $login $password
prompt
binary
bell
cd $directory
put "$filename"
bye
open $server 21
user $login $password
prompt
binary
bell
cd $directory
put "$filename"
bye
EOF
exit 0
转载于:https://blog.51cto.com/susanpray/192848