Linux - Shell - expect 用法

1 expect -c "
2 spawn scp /root/.ssh $IP:/root/.ssh;
3 expect {
4     \"yes/no\" { send \"yes\n\";exp_continue }
5     \"password\" { send \"$PASSWD\n\" }
6 }
7 "

 

posted @ 2021-06-06 21:56  每天都在学习的自己  阅读(288)  评论(0)    收藏  举报