expect可否模擬特殊鍵?(CTRLZ之類) - BBS

Table of Contents

其實我是想知道expect模擬backspace鍵的方法...
可是在網路上找了不少資料,
卻沒看到過模擬特殊鍵的方法,
所以po出來問各位大大...

man expect有這段,可是查不太到那些代碼的相關資料...

set CTRLZ \032
interact {
-reset $CTRLZ {exec kill -STOP [pid]}
\001 {send_user "you typed a control-A\n";
send "\001"
}
$ {send_user "The date is [exec date]."}
\003 exit
foo {send_user "bar"}
~~
}

--

All Comments