Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I wanted to record a linux session so I could use it as documentation for a "how to install" guide. I found something on the internet that suggested that the script command would be good for this, and so I started it and ran through my installation.

Of course, I didn't read closely enough to realize that the script command actually records keystrokes, so when I go to create my documentation it's full of lines that look like this:

$ make test[K[K[K[Kinstall[1@s[1@u[1@d[1@o[1@

I know that I can use script replay to play the script back, but what I really want to do is run something like scriptreplay but pipe the list of commands that would get executed to a file (I don't want to actually run them).

Is this possible?

I know about the history command, which I probably should have used instead, but I don't have access to the session's history anymore.

share|improve this question
1  
Maybe I'm too tired, but as I understand the scriptreplay man page, it won't execute the programs anyway: "The replay simply displays the information again; the programs that were run when the typescript was being recorded are not run again." –  Ulrich Schwarz Dec 21 '11 at 20:53
    
Huh, I think you're right! Guess I'm the one that's tired... Unfortunately I don't think I have a paired timing file. Is that something that can be generated? –  Cory Dec 21 '11 at 21:06
    
I have no idea, sorry. –  Ulrich Schwarz Dec 21 '11 at 21:20
1  
check out Mark Lodato's vt100.py. It's a lightweight python script that will strip the control characters out of your typescript file, leaving you with only what you would have seen on the terminal. From there it should be pretty easy to extract the commands you ran. Find it at github.com/MarkLodato/vt100-parser/blob/master/vt100.py –  Tim Kennedy Dec 22 '11 at 4:33

2 Answers 2

For future reference, you could open a shell in emacs with 'M-x shell'. Then the commands you type and the responses are captured in an emacs buffer that you can save to a file.

share|improve this answer

http://shelr.tv/ is what you need. It allows you to publish typescripts and replay them locally or on the web. It uses script or ttyrec (when script is broken like on Macs or BSD) internally.

share|improve this answer
    
site is down now :( –  pihentagy 18 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.