shell脚本中如何实现scp传输?

示例脚本如下:

#! /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"

 

posted @ 2019-03-29 20:22  Jello  阅读(7572)  评论(0编辑  收藏  举报