Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

terminal io 2

Status
Not open for further replies.

nkm

Programmer
May 27, 2001
45
US
Hi

Can anyone give me some sample code to read terminal io.
Actually what I want to do is to have a process in the background which would record all user pressed keys.

Includes all commands executed, and text typed if an editor is opened.

thanks...
 
Hi,
Why not start up the UNIX program

script

script starts up a SHELL and LOGS everything typed in that shell.


Unless of course you need this on Windows. Then please feel free to ignore this post.

 
Hi
Thanks ...

Now all I need is a program to replay that script
 
You want expect.

Here is a script that does what you want:
Code:
#!/usr/bin/expect

log_user 0
exp_internal 0
set timeout -1
log_file [file join /tmp/ [exec date +%a-%T-%V]]

   spawn /bin/sh
   set id $spawn_id
   interact
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top