ssh命令:
ssh root@192.168.2.237
SCH脚本:
touch 192.168.2.237
chmod +x 192.168.2.237vi 192.168.2.237
脚本内容:
#!/usr/bin/expect set password root #upload spawn scp /root/workspace/HIT-ES-RTU/Debug/HIT-ES-RTU root@192.168.2.237:/opt set timeout 300 expect "root@192.168.2.237's password:" set timeout 300 send "$password\r" set timeout 300 send "exit\r" expect eof 原文链接:https://www.f2er.com/ubuntu/351249.html