У меня есть Perl Progaram его отпечатки выводятся с цветом. если я переопределяю вывод в файле и открываю его в vi, я вижу специальный символ цвета.
как то так.
^[[31;43mAnd this is red on_yellow too^[[0m
Каков наилучший способ удалить этот цветной символ из выходного файла?
Спасибо
Обновление:
Я попробовал thid regex. у меня это работает:
cat -v a|head
^[[30;41mThis is black on_red^[[0m
^[[30;41mAnd this is black on_red too^[[0m
^[[30;42mThis is black on_green^[[0m
^[[30;42mAnd this is black on_green too^[[0m
^[[30;43mThis is black on_yellow^[[0m
^[[30;43mAnd this is black on_yellow too^[[0m
^[[30;44mThis is black on_blue^[[0m
^[[30;44mAnd this is black on_blue too^[[0m
^[[30;45mThis is black on_magenta^[[0m
^[[30;45mAnd this is black on_magenta too^[[0m
$ cat -v a|head|perl -lane 's/\^\[\[\d+(;\d+)*m//g; print'
This is black on_red
And this is black on_red too
This is black on_green
And this is black on_green too
This is black on_yellow
And this is black on_yellow too
This is black on_blue
And this is black on_blue too
This is black on_magenta
And this is black on_magenta too