auto_scp.sh
#!/bin/sh
expect -c ”
spawn scp data.txt user@192.168.xxx.xxx:/tmp/
expect {
¥”Are you sure you want to continue connecting (yes/no)?¥” {
send ¥”yes¥r¥”
expect ¥”password:¥”
send ¥”(パスワード)¥r¥”
} ¥”password:¥” {
send ¥”(パスワード)¥r¥”
}
}
interact
”