Whenever I use the script command to record the keys I type or when I activate the logging mode in screen, all BS (Backspace) and ESC (Escape) key presses are also included in the file. e.g: cd ~/foo/tpBSBStmp.Is there a way to auto remove the BS or the ESC from the file so the final recorded command included in the file would be cd ~/foo/tmp?Btw, this also happens in the logging feature of Putty.I'm open to any scripts that remove the unwanted characters or even another commands that do the same job
Remove BS and ESC from Log files
shell;logs;gnu screen;putty
The output of script will always contain linefeeds, backspaces and ANSI escape sequences as stated in the manpage. Examples of programs that will correctly display all these are cat and more. cat typescript and more typescript will display typescripts exactly as it looked when you recorded them.If you still want to clean the typescripts, take a look at this script. It is a Perl script I stumbled upon some time ago that is made specifically for cleaning up typescripts made with script.Try it by running script-declutter myTypescript > cleanTypescriptHope this helps.Edit:Not really related to the answer, but you might be interested in TermRecord. It creates neat, self contained HTML and Javascript representation of your terminal sessions so that anyone can view them without any knowledge of how to handle typescripts. All they need is a web browser.