cho@sol4.cs.psu.edu (Sehyeong Cho) (04/27/91)
Hi, wizards. I know I can use ioctl to simulate keyboard input. But I don't know how to catch all output to my terminal (similar to script, but not using a pty. For instance, I must catch someone writing to my terminal by "write" or "talk"). Have an idea? Thanks.
urban@cbnewsl.att.com (john.urban) (05/07/91)
In article <y3cG#taz1@cs.psu.edu> cho@sol4.cs.psu.edu (Sehyeong Cho) writes: >Hi, wizards. >I know I can use ioctl to simulate keyboard input. >But I don't know how to catch all output to my terminal (similar to >script, but not using a pty. For instance, I must catch someone writing >to my terminal by "write" or "talk"). >Have an idea? > >Thanks. I've held off answering this question for some time. Too see if any good answers appear. I really haven't seen any. I've tried script(1) on UNIX System V/386 Release 4.0 and then had user's wall(1) and write(1) me. After I exited script, my typescript file did not have the wall messages or the other user's half of the write(1) session. Any ideas? Sincerely, John Urban
rickert@mp.cs.niu.edu (Neil Rickert) (05/07/91)
In article <1991May7.143641.10066@cbnewsl.att.com> urban@cbnewsl.att.com (john.urban) writes: >In article <y3cG#taz1@cs.psu.edu> cho@sol4.cs.psu.edu (Sehyeong Cho) writes: >>Hi, wizards. >>I know I can use ioctl to simulate keyboard input. >>But I don't know how to catch all output to my terminal (similar to > >I've held off answering this question for some time. Too see if any good >answers appear. I really haven't seen any. On answer is to move the session logging back one stage. If you login from some kind of PC with a terminal emulation program, you may be able to cajole the terminal emulator to log the complete session. (Recent version of kermit on many different types of micro support this, for example.) As another choice, I suppose you could originally login in with a different account, turn off talk, biff, etc, then invoke script. From script make the first command 'exec login', which should set up the right permissions on the pty, add the utmp entry, etc. Hopefully 'talk' sessions will then go through your script session. The price you pay is having to login twice. Of course you may leave the pty with the wrong ownership and permissions, causing trouble for the next potential user of that pty. And your entry in utmp may not be properly removed. I guess you can't have everything. -- =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= Neil W. Rickert, Computer Science <rickert@cs.niu.edu> Northern Illinois Univ. DeKalb, IL 60115 +1-815-753-6940