home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!siesoft!wstuart!stuart
- From: stuart@wstuart (Stuart Hood)
- Newsgroups: comp.unix.shell
- Subject: Re: Simulating keyboard input in interactive programs
- Message-ID: <1992Sep10.163557.10186@siesoft.co.uk>
- Date: 10 Sep 92 16:35:57 GMT
- References: <1992Sep9.045525.2667@ads.com>
- Sender: news@siesoft.co.uk (Usenet News)
- Organization: Siemens Nixdorf Information Systems Ltd.
- Lines: 38
-
- pdel@ADS.COM (Peter Delevoryas) writes:
- : #1.
- : How do you simulate a keypress in an interactive program
- : which is within a script ? (If this is a FAQ I'm dead, I know.
- : Oh well the public ridicule is worth the answer ).
-
- This is easier in sh. In csh you need a file (called fred, say):
-
- #!/bin/csh
- while (1)
- sleep 100 # or long enough for the restore to finish
- echo q
- end
-
- then enter:
-
- % ./fred | while (1)
- > restore ivf /dev/tape
- > mt fsf 1
- > end
-
- : #2
- : This is kind of related to #1. Our dial-in lines are set to
- : auto-log out after about 20 min. of inactivity. Short of
- : programming the terminal-server not to do this, how can I
- : keep a process going so that it always seems like I'm doing
- : something, even if I'm in the kitchen making a BLT (extra mayo).
- : Just starting up some kind of loop won't do it; it has to be
- : equal to a keypress from MY keyboard.
-
- I do not know how to do this in a machine independent way.
-
- Stuart.
- -
- --
- S I E M E N S Stuart Hood === Siemens Nixdorf House, Bracknell, Berks, UK
- ------------- Phone: + 44-344-850892 Email: stuart@siesoft.co.uk
- N I X D O R F - Never let ignorance stand in the way of a good argument -
-