neil 2023-07-29 15:32:50 +08:00
parent c42ed9c693
commit a51025fe8f

View File

@ -924,7 +924,9 @@ _sed_i() {
} }
_egrep_o() { _egrep_o() {
if ! egrep -o "$1" 2>/dev/null; then if _exists egrep; then
egrep -o "$1" 2>/dev/null;
else
sed -n 's/.*\('"$1"'\).*/\1/p' sed -n 's/.*\('"$1"'\).*/\1/p'
fi fi
} }