Skip to content

Commit

Permalink
fix #4835
Browse files Browse the repository at this point in the history
  • Loading branch information
neil committed Oct 22, 2023
1 parent e15513b commit fe890c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion acme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ fi

_egrep_o() {
if [ "$__USE_EGREP" ]; then
egrep -o -- "$1"
egrep -o -- "$1" 2>/dev/null
else
sed -n 's/.*\('"$1"'\).*/\1/p'
fi
Expand Down

4 comments on commit fe890c6

@win-t
Copy link

@win-t win-t commented on fe890c6 Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, why not grep -E ?

@Neilpang
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some old platforms, grep doesn't have a -E option.

@cerealconyogurt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, that is my case (Asustor NAS) (Linux version 5.13.x (x86_64-asustor_x64_g3_2020.12.24-linux-gnu-gcc)

@df8oe
Copy link

@df8oe df8oe commented on fe890c6 Dec 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A clean solution would be to check if grep has -E option and if so use grep -E. For dinosaurs egrep can be used. "Obsolete" means this will be removed soon. So no workaraound but a solution would be the correct answer.
grep --help | grep 'extended-regexp'
results in an empty string if -E is not available...

Please sign in to comment.