Fix typescript files generated with script command

Generally quite a lot of us would have used the script command. This generates the logs for the session. But the problem with the logs is that it contains a lot of un-readable characters. These characters are mostly from the color codes, and as such can be removed very easily with a single command:

cat typescript | 
 perl -pe 's/e([^[]]|[.*.*?[a-zA-Z]|].*?a)//g' | col -b > typescript-processed

This assumes the input log file is named as typescript and the output is kept as typescript-processed. You can change the names as required.

 

 

Enhanced by Zemanta

Leave a Reply