From 6551e513ba7f833230cc7d11fddde9db12f71192 Mon Sep 17 00:00:00 2001 From: Bertho Stultiens Date: Mon, 23 Dec 2024 18:09:58 +0100 Subject: [PATCH] Replace obsolete 'egrep' with 'grep -E' --- docs/src/checkref | 2 +- scripts/githelper.sh | 2 +- scripts/swish | 8 ++++---- src/configure.ac | 1 - tests/module-loading/rtapi-app-main-fails/checkresult | 4 ++-- tests/module-loading/shared-test.sh | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/src/checkref b/docs/src/checkref index 0779bd4140d..ca467ebd1d3 100755 --- a/docs/src/checkref +++ b/docs/src/checkref @@ -23,7 +23,7 @@ for F in $FILES; do OUT=.checklink.$LANGUAGE.$(basename $F).tmp rm -f $OUT linuxcnc-checklink --quiet --exclude "(http|https|irc)://" $F 2>&1 | tee $OUT - egrep -q 'List of (broken links and other issues|duplicate and empty anchors)' $OUT + grep -E -q 'List of (broken links and other issues|duplicate and empty anchors)' $OUT if [ $? -ne 1 ]; then BAD_LINKS=1 fi diff --git a/scripts/githelper.sh b/scripts/githelper.sh index ede5ad65486..283192d2f13 100644 --- a/scripts/githelper.sh +++ b/scripts/githelper.sh @@ -16,7 +16,7 @@ function githelper() { if [ -z "$1" ]; then - GIT_BRANCH=$(git branch | egrep '^\*' | cut -d ' ' -f 2) + GIT_BRANCH=$(git branch | grep -E '^\*' | cut -d ' ' -f 2) if [ "$GIT_BRANCH" = "(no" ]; then echo "'git branch' says we're not on a branch, pass one in as an argument" > /dev/null 1>&2 return diff --git a/scripts/swish b/scripts/swish index adaec6f7323..59037dc5cd6 100755 --- a/scripts/swish +++ b/scripts/swish @@ -59,7 +59,7 @@ Usage: by swish is grepped for this pattern, and matching lines are printed. By default, $b attempts to turn swish-pattern into a grep-pattern, but this only works if swish-pattern is a simple - word. For more information about grep patterns, see 'man egrep' + word. For more information about grep patterns, see 'man grep' EOF exit 1 } @@ -69,7 +69,7 @@ while getopts "hRF:" opt do case "$opt" in R) FORCEREBUILD=1 ;; - F) FILEFILTER="egrep -z -e $OPTARG" ;; + F) FILEFILTER="grep -E -z -e $OPTARG" ;; h|?) usage ;; esac done @@ -91,9 +91,9 @@ fi if ! [ -z "$FILEFILTER" ]; then swish-e -f $SWISHINDEX -H0 -x '\0' -w "$PAT" \ | $FILEFILTER | makerelative \ - | xargs -0 egrep -Hnis -e "$REGEXP" + | xargs -0 grep -E -Hnis -e "$REGEXP" else swish-e -f $SWISHINDEX -H0 -x '\0' -w "$PAT" \ | makerelative \ - | xargs -0 egrep -Hnis -e "$REGEXP" + | xargs -0 grep -E -Hnis -e "$REGEXP" fi diff --git a/src/configure.ac b/src/configure.ac index 5ccf4949e78..d17b1d1f3d9 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -73,7 +73,6 @@ fi AC_SUBST([EMC2VERSION]) AC_PATH_PROG(GREP, grep) -AC_PATH_PROG(EGREP, egrep) # # check for pkg-config diff --git a/tests/module-loading/rtapi-app-main-fails/checkresult b/tests/module-loading/rtapi-app-main-fails/checkresult index c9eb377ab28..5b646386e8d 100755 --- a/tests/module-loading/rtapi-app-main-fails/checkresult +++ b/tests/module-loading/rtapi-app-main-fails/checkresult @@ -7,13 +7,13 @@ if [ ! -f $STDERR ]; then fi # Linux spelling of ERANGE -if egrep -q 'rtapi_app_main_fails.* Numerical result out of range' $STDERR; then +if grep -E -q 'rtapi_app_main_fails.* Numerical result out of range' $STDERR; then echo "loadrt found the test component, and it failed to load" exit 0 fi # FreeBSD spelling of ERANGE -if egrep -q 'rtapi_app_main_fails.* Result too large' $STDERR; then +if grep -E -q 'rtapi_app_main_fails.* Result too large' $STDERR; then echo "loadrt found the test component, and it failed to load" exit 0 fi diff --git a/tests/module-loading/shared-test.sh b/tests/module-loading/shared-test.sh index 94a28c1a1ca..4f5780138b4 100644 --- a/tests/module-loading/shared-test.sh +++ b/tests/module-loading/shared-test.sh @@ -3,7 +3,7 @@ halrun setup.hal > hal-output 2>&1 RESULT=$? -NUM_PINS=$(cat hal-output | egrep $(cat PIN_NAME_REGEX) | wc -l) +NUM_PINS=$(cat hal-output | grep -E $(cat PIN_NAME_REGEX) | wc -l) if [ $RESULT -ne $(cat RESULT) ]; then exit 1