首页 > 解决方案 > 如何在 Expect/Tcl 中发送 ctrl+d?

问题描述

以下在发送后挂起foo\rctrl+d未触发)。

编辑:不知何故,用\x04作品\x04\x04代替。不知道为什么必须发送两次控制字符...</p>

expect {
  -re {Type foo and press enter, then ctrl\+d} {
    send "foo\r\x04"
  }
}

标签: tclexpect

解决方案


推荐阅读