Home > OS > How to deal with the escape character of script log
How to deal with the escape character of script log
Time:02-07
Issue the following description: 1. Use script command on Linux can record the current user's commands and command echo, and the record to the log file is as follows: $script Through the cat can view operation record:
Through the vim editor will see a lot of escape character, as follows:
Problems come, now I want to have a program to read the log file, then line-by-line parsing the contents, but read data containing the H ^ ^ [[K data such as, how to eliminate this? For example: # PE H ^ ^ [[Kwd Is actually # PWD. What do you have any tool or function or procedure can handle this control characters?