Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Wanted: humanly readable `script` output

by repellent (Priest)
on May 08, 2008 at 08:11 UTC ( #685407=note: print w/replies, xml ) Need Help??

in reply to Wanted: humanly readable `script` output

This is a best-effort to strip out most ANSI escape sequences:
cat typescript | perl -pe 's/\e([^\[\]]|\[.*?[a-zA-Z]|\].*?\a)//g' + | col -b

Replies are listed 'Best First'.
Re^2: Wanted: humanly readable `script` output
by Anonymous Monk on Mar 02, 2013 at 15:39 UTC

    Why, oh why do I always see people explaining away a tough problem as 'impossible to answer'? We're not discussing the halting problem or anything like that. I don't think it proper for monks (Perl or otherwise) to simply shrug off a tough problem as impossible to solve. Rather argue about it in order to find a solution (like Tibetan monks do, with great passion :-) )

    First: let's get the original poster's question and later clarification right: in simple terms of analogy: if you consider (scrolling) terminal output to be a movie of a special kind of printer which prints (and occasionally erases) text on the screen, and scrolling up the screen as feeding the (continuous feed) 'paper' out the top of the screen, then what he wants (and also what he doesn't need, e.g. full state recovery from every point in time) becomes very clear. The very fact that scrollback buffers exist and can be copied (although not very conveniently) corroberates this.

    That anology should put your mind on the right track: printer, paper...hardcopy!

    One simple Google session then quickly brings up the solution: use Gnu/screen for your session. Start it with $ screen -h <scrollback buffer size>. At the shell prompt that appears, type all the commands (including whatever typos / editing), then when you're done issue <Ctrl-A> :hardcopy -h <dumpfile>.

    That's it. You can use whatever full-screen application (vi(m), mc, emacs) you like inside the session, only the last screenful from that will be saved.

    More information here:

      Why, oh why do I always see people explaining away a tough problem as 'impossible to answer'?

      Because you're hallucinating

        Must be the strong Tibetan mountain tea I drank this morning.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://685407]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2020-12-03 20:48 GMT
Find Nodes?
    Voting Booth?
    How often do you use taint mode?

    Results (57 votes). Check out past polls.