From 9548f066990ce5bdc19af720cc6cfe7adfdfba99 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 22 Jan 2011 14:36:36 -0800 Subject: Added stripansi.sh, for sending 'cabal test' output to file. cabal test | ./stripansi.sh > test.log. --- stripansi.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 stripansi.sh 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 -- cgit v1.2.3