Skip to content

Commit 15ee036

Browse files
author
neil
committed
fix for solaris
1 parent 6db8ae4 commit 15ee036

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

acme.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -923,11 +923,17 @@ _sed_i() {
923923
fi
924924
}
925925

926+
if [ "$(echo abc | egrep -o b 2>/dev/null)" = "b" ]; then
927+
__USE_EGREP=1
928+
else
929+
__USE_EGREP=""
930+
fi
931+
926932
_egrep_o() {
927-
if _is_solaris; then
928-
sed -n 's/.*\('"$1"'\).*/\1/p'
929-
else
933+
if [ "$__USE_EGREP" ]; then
930934
egrep -o "$1"
935+
else
936+
sed -n 's/.*\('"$1"'\).*/\1/p'
931937
fi
932938
}
933939

0 commit comments

Comments
 (0)