home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!mips!swrinde!gatech!cc.gatech.edu!cloudgen1!clayton
- From: clayton@cloudgen1.gatech.edu (R. Clayton)
- Newsgroups: comp.lang.tcl
- Subject: How to expect.
- Message-ID: <1992Aug21.164145.11775@cc.gatech.edu>
- Date: 21 Aug 92 16:41:45 GMT
- Sender: news@cc.gatech.edu
- Organization: College of Computing, Georgia Institute of Technology
- Lines: 19
-
- I have a program that presents text a screen at at time. I have an expect
- front-end to the program that issues a sequence of page commands, picks apart
- the screens and prints the resulting text with send_user. I'd like to run the
- text through a pager (e.g., more) so the user can control the spew of text, but
- am unsure how to go about it.
-
- One thing I could do is write the text to a file, spawn a pager on the file,
- and then let the user interact with the pager. This is the effect I want, but
- I don't want to have the user sitting around waiting while the script writes
- 400+ pages to a file. Another possibility is to fork with the file writer in
- one copy and the pager in the other, but this raises coordination problems
- (e.g., when the user pages to the current end-of-file before the writer
- finished writing the file) in addition to the fact that I haven't been able to
- get sample scripts written in this style to work. A third possibility is to
- make a pipeline with the pager and multiplex between the two tasks in the
- script itself, but I haven't been able to come up with a multiplexing scheme
- that doesn't involve re-implementing the pager in the script.
-
- Any ideas?
-