From 2614deb13882520013243bb70ac6d70fd4301606 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 13 Feb 2019 13:49:53 +0100 Subject: [PATCH] tests/invocation: Use ggrep if available We use grep -o here to filter output, but that's not available on OpenIndiana. It does offer "ggrep" though, which is GNU grep. --- tests/invocation.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/invocation.sh b/tests/invocation.sh index e1f6a8ef2..8ced43e4e 100755 --- a/tests/invocation.sh +++ b/tests/invocation.sh @@ -139,7 +139,13 @@ filter() { if [ -f "$1" ] ; then # grep '-o', '-E' and '-f' are supported by the tools in modern GNU # environments, and on OS X. - grep -oE -f "$1" + # + # But not on OpenIndiana/Illumos, so we use ggrep if available. + if command -v ggrep >/dev/null 2>&1; then + ggrep -oE -f "$1" + else + grep -oE -f "$1" + fi else cat fi