http://www.perlmonks.org?node_id=684471


in reply to Re: Wanted: humanly readable `script` output
in thread Wanted: humanly readable `script` output

Thanks for the suggestions everyone, but there are a lot of other control characters besides the backspace. If you are at a unix terminal, try this:
script ls exit
Then look in typescript. You'll see what I mean. Actually, there is a semi-passable solution that does not involve perl:
TERM=dumb script ls exit cat typescript | col -b > readable.txt
This seems to work as long as all the commands you type after script work on a dumb terminal. I was just wondering if perl had a more robust solution. I had a look at Term::Cap, but I fail to understand how to use it. I feel there must be a solution because, after all, I can see the very text I want on the terminal screen -- it's all right there! -- until my buffer size is reached. Usually copy/paste with the mouse from terminal to emacs works ok, but it didn't work the other night when I was compiling a kernel -- the output exceeded my buffer size.