-2

I am going through some logs written by a program that normally just logs to the console. Since it outputs to bash, I see a bunch of characters which are used for coloring in bash.

Is there any text editor out there that can interpret these character sequences and display the lines in color as bash does? Would be nice to be able to search through these logs without seeing a bunch of otherwise garbage characters.

Maxthecat
  • 1,250
  • 17
  • 37

1 Answers1

0

If you don't want to use an editor you could use:

echo -e $(cat colorfile)
less -r colorfile

Or use vim addon AnsiEsc:

Download the AnsiEsc.vba.gz vim scripts file from (https://www.vim.org/scripts/download_script.php?src_id=14498)

Install details:

Open the AnsiEsc.vba.gz vim-scripts file in vim:

vim AnsiEsc.vba.gz 
:so % 
:q 

Then open your file with vim and type

:AnsiEsc 
Paul Dawson
  • 1,332
  • 14
  • 27