2 cent tip: Interpreting color escape sequence
Mulyadi Santosa [mulyadi.santosa at gmail.com]
Thu, 29 Nov 2007 17:02:14 +0700
Suppose you have recorded your console session with "script" command. And then you want to display it via simple "less" command. But wait, you see: (note: by default ls use coloring scheme via command aliasing, so if you don't have it, simply use ls --color)
ESC]0;mulyadi@rumah:/tmp^GESC[?1034h[mulyadi@rumah tmp]$ ls ESC[00mESC[00;34mgconfd-doelESC[00m ESC[00;34mvirtual-mulyadi.Bx4b1XESCHow do you make these "strange" characters to appear as color? Use less -r <your script file> and you'll see colors as they originally appear.