-bash-4.2# cat ftp-expect.sh
spawn ftp 192.168.56.1
expect "):"
send "ftp\r"
expect "Password:"
send "123456\r"
expect "ftp>"
send "put ftp-expect.sh\r"
expect "ftp>"
send "quit\r"
-bash-4.2#
标签:ftp,shell,编程语言,4.2,send,sh,expect From: https://www.cnblogs.com/cherishthepresent/p/17207211.html