示例脚本如下:

#! /bin/sh
expect -c "
    spawn scp -r /home/jello/jello.txt jello@110.110.110.110:/home/jello/ 
    expect {
        \"*assword\" {set timeout 20; send \"jello\r\"; exp_continue;} #此处的jello为密码,自行替换
    }
expect eof"

 

相关文章:

  • 2022-01-10
  • 2022-12-23
  • 2021-12-19
  • 2021-05-24
  • 2021-12-18
  • 2022-03-08
  • 2021-11-20
  • 2021-08-18
猜你喜欢
  • 2022-12-23
  • 2022-02-27
  • 2021-10-10
  • 2021-12-19
  • 2021-12-19
相关资源
相似解决方案