サーバー上でセットアップを実行するためのスクリプトを作成しましたが、sendステートメントの実行中にスキップされ、その他のステートメントの実行が実行されています。私はそれが実行取得されていない前にコマンドを送信疑問を持っている予期しないスクリプトが機能しない状態を送信しました。
enter code here[code written][1]
====================ERROR m getting=============================
Enter the name of the new namespace you want to create [coe_ns] :
Enter the name of the clearinghouse you want to create [coe_ch] : invalid command name "C"
while executing
"C"
invoked from within
"expect -re "* Option to execute (Continue/Restart/Quit) [C]: $""
(file "./TNS_Server_Setup.sh" line 21)
、また、私は正しい方法を「ENTER」渡しています:
以下は私のスクリプトです。
ありがとうグレン、私の期待出力に2行があるかどうかは別のクエリがあります。行または正規表現の両方が一致していることを確認してください。 例: スクリプトからデータ型 を入力してください。expect -re "データ型$を入力してください"と思ったらうまくいくはずです。 –