1

Possible Duplicate:
Removing control chars (including console codes / colours) from script output

Is there a utility which uncolors colored output? Something like the uncolor utility in the example below:

$ ./colored_output | uncolor > plain.txt

The aim is to remove characters like "[0m[32m" and "[0m[1m" which get additionally output.

Zaid
  • 10,642

1 Answers1

0

You should try

./colored_output |
    sed -r "s/\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" > plain.txt