Operating System - HP-UX
1846851 Members
4222 Online
110256 Solutions
New Discussion

Text Colors in AWK program

 
mazafar4
Occasional Contributor

Text Colors in AWK program

Hi,
I am building a report in awk program. I am using the xterm. how can I build a that report which can have multi-colors text.
2 REPLIES 2
Rainer_1
Honored Contributor

Re: Text Colors in AWK program

think there's no color functionality in xterm.
Look at this thread for using colors

http://forums.itrc.hp.com:80/cm/QuestionAnswer/1,1150,0xdac8d06ed8c8d4118fef0090279cd0f9,00.html
Carlos Fernandez Riera
Honored Contributor

Re: Text Colors in AWK program


export TERM=dtterm

reverse=`tput setab 1`
normal=`tput setab 2`

awk 'NR %2 == 1 { print reverse ; print ; print normal ; next}
{ print }' reverse=$reverse normal=$normal /etc/hosts


See man terminfo, and untic

unsupported