[SunHELP] removing patterns with control codes, ie colors


Fri Jan 24 08:19:42 CST 2003


I have output from a program that contains embedded ctrl codes for colors.
I am having trouble stripping these codes so as to have a plain text output
for transmission to my mobile cell.  Example:
using ctrl-v ctrl-[ [ 7m and ctrl-v ctrl-[ [ 0m 
appears as ^[7m AVAILABLE ^[0m on other devices other than the terminal
It is basically printing the word avaiable using white on black colors.
I tried sed s/^[[.m//g to remove all codes at once but sed complains the
command is garbled.  It will also complain if I dont use the regexp "."
Thanks for assistance in advance.


More information about the SunHELP mailing list