diff options
-rwxr-xr-x | stripansi.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/stripansi.sh b/stripansi.sh new file mode 100755 index 000000000..7f1a55da0 --- /dev/null +++ b/stripansi.sh @@ -0,0 +1,10 @@ +#!/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 |