CentOS7.6のexpectで以下のようなスクリプトを書いています。
cat <<EXP | expect
set send_slow {1 .5}
spawn telnet aa.bb.cc.dd
expect "User: " { send -s "username\r" }
expect "Password: " { send -s "password\r" }
expect "]# " { send -s "some command\r" }
expect "]# " { send -s "exit\r" }
expect eof
EXP
send_slowで1文字ずつ0.5秒のインターバルでsendしているのですが
CR"\r"を送るまでは画面にsend中の文字が表示されません。
cat <<EXP | stdbuf -i0 -e0 -o0 expect
としてもダメでした。
CR"\r"前にsend中の文字を一文字ずつ画面に表示させることは可能でしょうか?
あなたの回答
tips
プレビュー