mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rollup merge of #102092 - kxxt:patch-1, r=joshtriplett
refactor: use grep -E/-F instead of fgrep/egrep `egrep` and `fgrep` are obsolescent now. This PR updates all `egrep` and `fgrep` commands to `grep -E` and `grep -F`. Running egrep/fgrep command with grep v3.8 will output the following warning to stderr: ``` egrep: warning: egrep is obsolescent; using grep -E ``` - https://www.phoronix.com/news/GNU-Grep-3.8-Stop-egrep-fgrep - https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html
This commit is contained in:
@@ -26,7 +26,7 @@ Options:
|
||||
-i Case insensitive search.
|
||||
'
|
||||
|
||||
GREPPER=fgrep
|
||||
GREPPER=grep
|
||||
INVERT=0
|
||||
GREPFLAGS='q'
|
||||
while getopts ':vieh' OPTION; do
|
||||
@@ -39,7 +39,7 @@ while getopts ':vieh' OPTION; do
|
||||
GREPFLAGS="i$GREPFLAGS"
|
||||
;;
|
||||
e)
|
||||
GREPPER=egrep
|
||||
GREPFLAGS="E$GREPFLAGS"
|
||||
;;
|
||||
h)
|
||||
echo "$USAGE"
|
||||
@@ -51,6 +51,12 @@ while getopts ':vieh' OPTION; do
|
||||
esac
|
||||
done
|
||||
|
||||
if ! echo "$GREPFLAGS" | grep -q E
|
||||
then
|
||||
# use F flag if there is not an E flag
|
||||
GREPFLAGS="F$GREPFLAGS"
|
||||
fi
|
||||
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
# use gnu version of tool if available (for bsd)
|
||||
|
||||
Reference in New Issue
Block a user