Retry bash session with correct time delay

EDIT (this seems to be important, see below): I need a script to actually execute commands, and not just show what was written! The script utility does not do this as far as I know. So something like an automatic hotkey, only for bash and linux, with recorded time information.

The question was:

I would like to record and play a bash session with the exact time delay between keystrokes, etc.

For example, if I run a program called xxxand then expand it with Ctrl + C after 11.4s, and then run a program called yyy3.4s after exiting xxx, I would like the playback to do the same (break xxxwith Ctrl + C after 11.4s, wait 3.4 and then run yyy).

I do not need to record mouse movements, since everything that interests me occurs in one bash session.

I reviewed utilities as

  • script (It writes bash session commands, but without time delay information.)
  • xmacro (It records all keystrokes, but again there is no time information).
  • a person who is looking for something like this might also want to look this up (I include this link because of the possible value for other users; I personally have not found any of the solutions mentioned that are useful for what I want to achieve.)
+5
source share
2 answers

script -t is the standard answer.

I also rewrote the script in Python, which you can find here: http://stromberg.dnsalias.org/~strombrg/pypty/

Both support -t. The main reason I wrote pypty is because I wanted to get one file per day to log long ssh sessions for future reference.

pypty script -replay script ( scriptreplay), tty, gtk curses. - ( vt100 ), .

+2

bash , , bash bash? IO / bash, . . , .

+1

All Articles