下記のようにscpでのファイル取得を、expectコマンドで自動取得しています。
lang
1/usr/bin/expect -c " 2set timeout 300 3spawn scp -Cpqr $gProdUser@$gProdHost:$gTargetDir/$gSynchroFile $gBackupDir 4expect { 5\" Are you sure you want to continue connecting (yes/no)? \" { 6send \"yse\r\" 7expect \"password:\" 8send \"${gProdPass}\r\" 9} \"Password:\" { 10send \"${gProdPass}\r\" 11} 12} 13expect eof 14exit 15"
timeoutした際にエラーメッセージを出力したいのですが、timeoutしたことを知るにはどうすればいいのでしょうか?
ご助言よろしくお願いします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2015/06/09 00:28