Skip to content

Commit a7f4f4d

Browse files
committed
g: remove 'egrep'
Apparently this is deprecated and now causes warnings.
1 parent 3285e4f commit a7f4f4d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

g

+8-7
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ if command -v ack &>/dev/null; then
2828
exec ack "$@"
2929
fi
3030

31-
# Fallback: egrep or grep
32-
for GREP in egrep grep; do
33-
if command -v ${GREP} &>/dev/null; then
34-
find . 2>/dev/null -type f -print0 | xargs -0 -P $(getconf _NPROCESSORS_ONLN) ${GREP} --binary-files=without-match --color=always -HI "$@" | ${GREP} . | less -iRnSFX
35-
exit ${PIPESTATUS[2]}
36-
fi
37-
done
31+
# Fallback: grep
32+
if command -v grep &>/dev/null; then
33+
find . 2>/dev/null -type f -print0 | \
34+
xargs -0 -P $(getconf _NPROCESSORS_ONLN) \
35+
grep --binary-files=without-match --color=always --extended-regex -HI "$@" | \
36+
grep . | less -iRnSFX
37+
exit ${PIPESTATUS[2]}
38+
fi
3839

3940
printf 'no suitable tool found\n' >&2
4041
exit 1

0 commit comments

Comments
 (0)