git.iko.soy/typeable/pandoc
on master help sign in
Added stripansi.sh, for sending 'cabal test' output to file.

cabal test | ./stripansi.sh > test.log.

commit9548f066990ce5bdc19af720cc6cfe7adfdfba99 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 22 Jan 2011, 14:36 (16 years ago) parent91cc03b
1 file changed+10
stripansi.sh+10
stripansi.shnew file+10
@@ -0,0 +1,10 @@
1+#!/bin/sh
2+
3+# use th is to strip out ANSI codes, if you want to pipe
4+# outputof 'cabal test' to a file.
5+
6+if which -s gsed; then
7+ gsed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"
8+else
9+ gsed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"
10+fi