源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

expect中为send语句上加变量的代码

  • 时间:2020-03-19 17:56 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:expect中为send语句上加变量的代码
[u]复制代码[/u] 代码如下:
#!/usr/bin/expect set ssh_user "fivetrees" set password "123456" spawn ssh -i /root/.ssh/$ssh_user  root@xiaopp.3f.com expect_before "no)?" { send "yes\r" } sleep 1 expect "Enter passphrase for key*" send "$password\r" for {set snum 0} {$snum <= 6} {incr snum} { expect "*#" send "ls -l /opt/backup/fivetreesdb_s$snum\r" sleep 3 } sleep 2 expect "*#" send "echo\r" exit
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部