#!/bin/bash expect -c " set timeout 1200; spawn /usr/bin/scp -r 192.168.142.128:/shell/backup.tar.gz /shell expect { \"*yes/no*\" {send \"yes\r\"; exp_continue} \"*password*\" {send \"123456\r\";} } expect eof;"