ftp脚本:
#! /bin/sh
server=172.23.3.150
remotedir=/users/tmp/
filename=test.txt
ftp -in << EOM
open $server
user username password
bin
cd $remotedir
put $filename
bye
EOM
sftp脚本:
#!/bin/sh
HOST=172.23.3.150
USER=root
PASSWORD=1234rewq
FILENAME=test.txt
LOCAL_PATH=/home/ligt/WindRiver/
REMOTE_PATH=/users/tmp/
lftp -u $USER,$PASSWORD sftp://$HOST << EOM
lcd $LOCAL_PATH
cd $REMOTE_PATH
put $TARGET
bye
EOM
echo "Success!"