本文共 286 字,大约阅读时间需要 1 分钟。
#!/bin/bash
read -ep “请输入ip:” ip read -ep “请输入密码:” passwd read -ep “请输入文件绝对路径:” file/usr/bin/expect <<EOF
spawn scp $file KaTeX parse error: Undefined control sequence: \n at position 34: …yes" {send "yes\̲n̲;exp_untinue"} …passwd\n"}
expect “100%” {send "echo “$ip:成功”} expect eof EOF转载地址:http://clcef.baihongyu.com/