I'm on OS X, which has a BSD version of sed
(which I'm guessing is inferior to a GNU version on Linux), and all the techniques for removing color on commandlinefu.com did not work. I tried replacing the -r
switch (non-existent on OS X) with -e
, but that didn't help.
Is there some reliable way I can remove color formatting codes on OS X? Here's the command I'm running that needs color output stripped:
for concurrency in $(seq 1 50); do siege -f urls.txt -c $concurrency -t 5m >> results.csv ; done
and here's an example of trying to use sed
to strip the color from the CSV output:
for concurrency in $(seq 1 50); do siege -f urls.txt -c $concurrency -t 5m | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" >> results.csv ; done