0

How do I parse the output of script/utils-linux into human-readable form or into something I can process with regexps? There are some binary escape sequences used to display colours etc.

Is there a unix tool to record the text console (e.g. gnu screen) in a human-readable form with milliseconds timings ?

ttyrec/ttyplay uses a rather unreadable format I was not able to find proper documentation for; the screen function logstamp creates a somewhat more readable log but is unable to give precise timings, only up to a second.

2 Answers 2

1

You want the script command.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! One more question: it seems to use escape sequences/codes, how do I know what these mean? Is there some standard?
@John, those are probably coming from GNU Screen, not script From the script man page, "Certain interactive commands, such as vi(1), create garbage in the typescript file. Script works best with commands that do not manipulate the screen"
1

you can easily parese ttyrec with something like that: https://github.com/antono/shelr/blob/master/lib/shelr/ttyrec.rb

If you want to just share your terminal there is http://shelr.tv/ with corresponding utility: https://github.com/antono/shelr

If you want strip escape sequences you can do it with following command:

sed -r "s/\x1B[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.