expect可否模擬特殊鍵?(CTRLZ之類) - BBS
By Frederic
at 2005-10-01T23:36
at 2005-10-01T23:36
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"}
~~
}
--
可是在網路上找了不少資料,
卻沒看到過模擬特殊鍵的方法,
所以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"}
~~
}
--
Tags:
BBS
All Comments
Related Posts
postfix 的 maildrop
By Jacky
at 2005-09-30T11:54
at 2005-09-30T11:54
pure-ftpd
By Charlie
at 2005-09-29T23:34
at 2005-09-29T23:34
請問如何用防火牆限制telnet的登入ip?
By George
at 2005-09-29T16:54
at 2005-09-29T16:54
請問如何用防火牆限制telnet的登入ip?
By Eden
at 2005-09-29T14:17
at 2005-09-29T14:17
請問如何用防火牆限制telnet的登入ip?
By Irma
at 2005-09-29T10:18
at 2005-09-29T10:18