pandoc/stripansi.sh
John MacFarlane 9548f06699 Added stripansi.sh, for sending 'cabal test' output to file.
cabal test | ./stripansi.sh > test.log.
2011-01-22 14:36:36 -08:00

10 lines
247 B
Bash
Executable file

#!/bin/sh
# use th is to strip out ANSI codes, if you want to pipe
# outputof 'cabal test' to a file.
if which -s gsed; then
gsed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"
else
gsed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"
fi