Skip to content

Commit

Permalink
Replace obsolete 'egrep' with 'grep -E'
Browse files Browse the repository at this point in the history
  • Loading branch information
BsAtHome committed Dec 23, 2024
1 parent 1123be8 commit 6551e51
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/src/checkref
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/githelper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions scripts/swish
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand All @@ -91,9 +91,9 @@ fi
if ! [ -z "$FILEFILTER" ]; then
swish-e -f $SWISHINDEX -H0 -x '<swishdocpath>\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 '<swishdocpath>\0' -w "$PAT" \
| makerelative \
| xargs -0 egrep -Hnis -e "$REGEXP"
| xargs -0 grep -E -Hnis -e "$REGEXP"
fi
1 change: 0 additions & 1 deletion src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ fi
AC_SUBST([EMC2VERSION])

AC_PATH_PROG(GREP, grep)
AC_PATH_PROG(EGREP, egrep)

#
# check for pkg-config
Expand Down
4 changes: 2 additions & 2 deletions tests/module-loading/rtapi-app-main-fails/checkresult
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/module-loading/shared-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6551e51

Please sign in to comment.