Browse Source

fix egrep performance

neilpang 8 years ago
parent
commit
a3c0c7546d
1 changed files with 1 additions and 3 deletions
  1. 1 3
      acme.sh

+ 1 - 3
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
 }