aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-22 14:36:36 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-22 14:36:36 -0800
commit9548f066990ce5bdc19af720cc6cfe7adfdfba99 (patch)
treea5eec2f76caf857669bc6bb26ae7322416399318
parent91cc03b13105db519e1812970b29ed09ce6cf816 (diff)
downloadpandoc-9548f066990ce5bdc19af720cc6cfe7adfdfba99.tar.gz
Added stripansi.sh, for sending 'cabal test' output to file.
cabal test | ./stripansi.sh > test.log.
-rwxr-xr-xstripansi.sh10
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