請問expect的用法 - BBS

By Edward Lewis
at 2006-11-07T23:44
at 2006-11-07T23:44
Table of Contents
※ [本文轉錄自 Linux 看板]
作者: idleuser () 看板: Linux
標題: 請問expect的用法
時間: Tue Nov 7 23:44:01 2006
最近想寫個小程式固定post一些網頁上的內容到我BBS的板上去
利用wget、awk之類的工具把post的內容準備好之後
想利用expect連線到BBS(位置是在無名BBS)
程式是大概是像下面這樣短短的
#!/usr/bin/expect
spawn telnet -8 bbs.wretch.cc
expect "請輸入代號:"
send "xxxx\r"
expect "請輸入密碼:"
send "1234\r"
set space \0x40;
expect "請按任意鍵繼續"
send -- "\r"
send -- space
send -- "f\r" #跳到我的最愛
但是我的程式會block在"請按任意鍵繼續"這個地方
我接下來送出的換行和空白好像都沒有用
請問要怎麼處理呢?
也想順便請問一下,要怎麼在expect中送出上、下、左、右的訊息?
感謝指點
--
作者: idleuser () 看板: Linux
標題: 請問expect的用法
時間: Tue Nov 7 23:44:01 2006
最近想寫個小程式固定post一些網頁上的內容到我BBS的板上去
利用wget、awk之類的工具把post的內容準備好之後
想利用expect連線到BBS(位置是在無名BBS)
程式是大概是像下面這樣短短的
#!/usr/bin/expect
spawn telnet -8 bbs.wretch.cc
expect "請輸入代號:"
send "xxxx\r"
expect "請輸入密碼:"
send "1234\r"
set space \0x40;
expect "請按任意鍵繼續"
send -- "\r"
send -- space
send -- "f\r" #跳到我的最愛
但是我的程式會block在"請按任意鍵繼續"這個地方
我接下來送出的換行和空白好像都沒有用
請問要怎麼處理呢?
也想順便請問一下,要怎麼在expect中送出上、下、左、右的訊息?
感謝指點
--
Tags:
BBS
All Comments
Related Posts
Re: SCHED_ULE + mldonkey = 死當

By Freda
at 2006-11-07T17:30
at 2006-11-07T17:30
Re: 請教一個關於bash 設定的問題

By James
at 2006-11-06T19:10
at 2006-11-06T19:10
Re: 請教一個關於bash 設定的問題

By Jacob
at 2006-11-06T16:24
at 2006-11-06T16:24
pkgdb -F

By George
at 2006-11-06T03:32
at 2006-11-06T03:32
pkgdb -F

By Gilbert
at 2006-11-06T02:53
at 2006-11-06T02:53