![]() # If you want to skip all other lines, comment next line displayLog.awk) containing the following code: # output INFO lines in cyan With the example you provided you can create a awk script file (e.g. How to have tail -f show colored outputĪfter checking, you can directly output colored text in the terminal using awk.GNU grep has a fairly famous colourization bug in this area, but this is not a problem that is limited to grep. ![]() ![]() To get it completely right, a colourizer has to deal with automatic margins and the DEC VT pending line wrap mechanism, which I have yet to see any colourizer do. They hardwire control sequences, rather than using setaf/ setab and so forth from terminfo.Īlso note that colourization is tricky for subtler reasons, and almost no colourization program gets it right. It has the distinction of understanding logs that have TAI64N timestamps.Īlas, a few of these tools do colourization very wrongly. Lambert's logtool is specifically designed for post-processing log files, and has a complex (and alas badly documented) configuration system that permits one to assign a file full of regular expressions to each one of 13 colours. Awk, as mentioned in other answers, is definitely the tool to reach for first.īut it isn't the only tool, by a long shot.Ī. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |