Quantcast
Channel: Program that passes STDIN to STDOUT with color codes stripped? - Unix & Linux Stack Exchange
Browsing all 8 articles
Browse latest View live

Answer by user254560 for Program that passes STDIN to STDOUT with color codes...

You can use ac for this. It should be faster than anything listed above (though perl and sed should be decent). Here's an example:curl -s wttr.in/LA | ac -sAs a disclaimer: the color filtering...

View Article



Answer by JJoao for Program that passes STDIN to STDOUT with color codes...

$ command-that-produces-colored-output | ansifilter... and if necessary, (dnf, ...) install ansifilter

View Article

Answer by David McNamara for Program that passes STDIN to STDOUT with color...

If your system has access to NodeJS you could install the following Node package, strip-ansi-cli.$ npm install -g strip-ansi-cliYou can then run your command like so:$...

View Article

Answer by Ben for Program that passes STDIN to STDOUT with color codes stripped?

This sed command did it for me:sed -r "s/\\^\\[(\\[[^@-~]+[@-~]|[0-9@-_]|%@)//g"Example:$ command-that-produces-colored-output | sed -r "s/\\^\\[(\\[[^@-~]+[@-~]|[0-9@-_]|%@)//g"> outfile

View Article

Answer by jfs for Program that passes STDIN to STDOUT with color codes stripped?

Remove color codes (special characters) with GNU sedsed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"OrStrip ANSI escape sequences in PythonInstall colorama python package (pip install colorama)....

View Article


Answer by Ryan C. Thompson for Program that passes STDIN to STDOUT with color...

If you can install the Term::ANSIColor module, this perl script works:#!/usr/bin/env perluse Term::ANSIColor qw(colorstrip);print colorstrip $_ while <>;

View Article

Answer by cjm for Program that passes STDIN to STDOUT with color codes stripped?

You'd think there'd be a utility for that, but I couldn't find it. However, this Perl one-liner should do the trick:perl -pe 's/\e\[?.*?[\@-~]//g'Example:$ command-that-produces-colored-output | perl...

View Article

Program that passes STDIN to STDOUT with color codes stripped?

I have a command that produces output in color, and I would like to pipe it into a file with the color codes stripped out. Is there a command that works like cat except that it strips color codes? I...

View Article

Browsing all 8 articles
Browse latest View live




Latest Images