use perl instead of sed -r to strip colors in test

`sed -r` is not present on some BSD based systems, including MacOSX
Darwin.  perl is standard pretty much everywhere, so this a more
reliable way to test.

Since this is only used for tests, any performance differences
should not matter significantly.
This commit is contained in:
Matthew Rothenberg
2014-10-16 15:31:12 -04:00
parent b395596496
commit b2d86a16b2

View File

@@ -15,7 +15,7 @@ fi
# Strip color codes from a string # Strip color codes from a string
strip_colors() { strip_colors() {
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" perl -pe 's/\e\[[\d;]*m//g'
} }
# Print space separated tab completion options # Print space separated tab completion options