expect
Perl スクリプトでシステム コールを使用して、リモート サーバー上にディレクトリを再帰的に作成しようとしています。関連する呼び出しは次のとおりです。
system("expect -c 'spawn ssh $username\@$ip; expect '*?assword:*' {send \"$password\r\"}; expect '*?*' {send \"mkdir -p ~/$remote_start_folder/$remote_folder_name/$remote_username/$remote_date/\r\"}; expect '*?*' {send \"exit\r\"}; interact;'");
これはうまくいきます。ただし、 を使用してリモート amchine に初めてアクセスするssh
場合は、確認を求められ(yes/no)
ます。上記のステートメントのどこにそれを追加すればよいかわかりません。それを上記のステートメントに組み込む方法はありますか(ある種のor
-ingを使用)?