#!/bin/bash
ftppath="reliability/sniff/"
usscript="upsnifferlog.sh"
server1="xxx.xxx.xxx.xxx"
#1,download the two files
ftp -n<<!
open $server1
user snap mygehc
cd $ftppath
ls
binary
prompt
get $usscript
close
bye
!
chmod +x $usscript
#2,scp file2 to the magic pc and run it
scp $usscript root@magic:/database/
ssh magic /database/$usscript
ssh magic /database/$usscript这个是公司电脑A要ssh到电脑B,然后在电脑B上运行$usscript。