[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Highlighting CLI output: what are these terms called?



"Morel Bérenger" <berenger.morel@neutralite.org> wrote:
> Le Mer 17 avril 2013 10:22, Dotan Cohen a écrit :
>> tail -f file.log | perl -pe 's/keyword/\e[1;31;43m$&\e[0m/g'

> Those are escape sequences from VT100 IIRC.

These escape sequences do not need to be embedded into your programs;
they can be derived in a terminal-independent manner. See "man 5 terminfo"
for gory details.

Here's an example that will display "world" in standout - but only on
suitably capable terminals:

    echo "Hello" $(tput smso)"world"$(tput rmso) "as you can see."

Chris


Reply to: