record the terminal session and replay later
May 11th, 2007 mysurface Posted in Misc, script, scriptreplay | Hits: 63461 | 14 Comments »
I have read this at linuxinsight, which is amazing. You can actually record down your typing, screen output even you are running ncurses cli, all the data will store into a file and the timing will be into another file. With this two files, you can have scriptreplay to replay it all with the correct timing.
Recording goes like this
script -t 2> tutorial.timing -a tutorial.session
type ‘exit’ to end the recording.
Replay goes like this
scriptreplay tutorial.timing tutorial.session
Both session and timing file is readable, if you do not need to be replay, just do
script -a tutorial.txt
You might be asking what have script did? logged your input as well as screen output? That means the password will be recorded as well when you do sudo? The answer is NO, script save only the things that is visible to you, not your keyboard hit. Same things goes to scriptreplay, it just play what ever is recorded, no real command executing during replay.
I found that generating and replay with two files (session and timing files) is a bit messy. Therefore I created a bash script to cater that, I name it as script.sh. it will be creating only one file (it is just a dirty trick, read the bash script you will understand), replay and record uses script.sh is convenience.
To record,
./script.sh -r
To play,
./script.sh -p
Get script.sh and try it out. Remember to chmod +x after extract from the tar ball.
Oh ya, I included my output file here – matrix, download it and try to play with script.sh.
./script.sh -p matrix
Have Fun :)
[䏿–‡ç¿»è¯‘ï¼½







January 4th, 2008 at 3:18 am
Oh my gosh, that matrix typescript is freaking awesome cool!
April 17th, 2008 at 12:48 pm
New software by http://ObserveIT-sys.com enables window session recording and replaying. This is an enterprise scale solution that supports recording of thousands of window servers. All recording are searchable for any activity within them.
May 6th, 2008 at 2:21 am
[...] There are many function with script see also – Record the terminal session and replay later [...]
April 14th, 2009 at 10:09 am
although I know the tool script, but never know it can be so amazing. I have been search all the web until find your article.
August 11th, 2009 at 6:53 pm
ultimate !!
September 27th, 2010 at 5:43 pm
Also there is a site called PLAYTERM (www.playterm.org) which replays your ‘script’ sessions online.
January 12th, 2012 at 10:45 am
[...] the internet searching for exactly how to record a screencast of this nature, I ran across a blog post talking about how to play back terminal sessions using the output of the script program. This [...]
April 6th, 2012 at 8:59 pm
Check out http://shelr.tv/. It much easier than calling script by hand.
April 25th, 2012 at 4:30 pm
hmmm true, script is a poorman’s ttyrec.
I just found out http://www.playterm.org supports ttyrec now.
May 9th, 2012 at 6:25 am
I have just created a gist for it.
February 22nd, 2013 at 7:19 am
Any ideea how to call $exit within a shell script ?
March 1st, 2013 at 6:48 am
I’ll right away clutch your rss feed as I can’t in finding your email subscription hyperlink or e-newsletter service.
Do you’ve any? Please permit me know so that I may just subscribe. Thanks.
April 2nd, 2013 at 9:17 am
Please let me know if you’re looking for a article writer for your site. You have some really good articles and I feel I would be a good asset. If you ever want to take some of the load off, I’d
really like to write some material for your blog in exchange
for a link back to mine. Please blast me an email if interested.
Thanks!
May 3rd, 2013 at 7:31 am
Hello colleagues, fastidious article and good urging commented here, I am
genuinely enjoying by these.