From a3c0c7546df4d4e8d8dc384b0642101572085fd3 Mon Sep 17 00:00:00 2001 From: neilpang Date: Fri, 18 Nov 2016 20:14:08 +0800 Subject: [PATCH] fix egrep performance --- acme.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/acme.sh b/acme.sh index 6f948f51..e3f844ea 100755 --- a/acme.sh +++ b/acme.sh @@ -349,10 +349,8 @@ _sed_i() { } _egrep_o() { - if _contains "$(egrep -o 2>&1)" "egrep: illegal option -- o"; then + if ! egrep -o "$1" 2>/dev/null; then sed -n 's/.*\('"$1"'\).*/\1/p' - else - egrep -o "$1" fi }