home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / shell / 3883 < prev    next >
Encoding:
Internet Message Format  |  1992-09-10  |  1.6 KB

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