home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!sun-barr!ames!ads.com!pdel
- From: pdel@ADS.COM (Peter Delevoryas)
- Subject: Simulating keyboard input in interactive programs
- Message-ID: <1992Sep9.045525.2667@ads.com>
- Sender: usenet@ads.com (USENET News)
- Organization: Advanced Decision Systems, Mtn. View, CA (415)960-7300
- Distribution: usa
- Date: Wed, 9 Sep 1992 04:55:25 GMT
- Lines: 54
-
- Okay I've been reading for over two weeks, plus yesterday I caught up
- on 500 articles, so I should be entitled to: THE POST!!
-
- Not only that, I have two (somewhat related) questions :
-
-
- #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 ).
-
- Example: (csh)
-
- % while ( 1 )
- > restore ivf /dev/tape
- > mt fsf 1
- > end
-
- Now upon execution of the restore, this will give me the
- partition name and dumpdate, which is what I want to see.
- Since it's interactive, it will wait for a prompt to tell
- it what to do next. All I want to do is get the script to
- type in a 'q' to make the restore quit so 'mt fsf' can go
- to the next filemark.
-
-
- I don't want to do 'restore t' because that won't give me
- the dumpdates and partition name.
-
- So how can I put the 'q' character in there at the right time?
-
-
-
- #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.
-
- This probably belongs in unix.sys or some-such, but, since I'm
- here already..... okay, I'll cross-post.
-
-
-
- thanks for help, PD
-
- --
-
- login name: L1-A
- In real life: Peter Delevoryas
- In any other life: a cheap imitation
-