Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/lkdtm: Use grep -E instead of egrep

shellcheck complains that egrep is deprecated, and the grep man page
agrees. Use grep -E instead.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Michael Ellerman and committed by
Shuah Khan
851c4df5 f131d9ed

+4 -4
+4 -4
tools/testing/selftests/lkdtm/run.sh
··· 25 25 # Figure out which test to run from our script name. 26 26 test=$(basename $0 .sh) 27 27 # Look up details about the test from master list of LKDTM tests. 28 - line=$(egrep '^#?'"$test"'\b' tests.txt) 28 + line=$(grep -E '^#?'"$test"'\b' tests.txt) 29 29 if [ -z "$line" ]; then 30 30 echo "Skipped: missing test '$test' in tests.txt" 31 31 exit $KSELFTEST_SKIP_TEST 32 32 fi 33 33 # Check that the test is known to LKDTM. 34 - if ! egrep -q '^'"$test"'$' "$TRIGGER" ; then 34 + if ! grep -E -q '^'"$test"'$' "$TRIGGER" ; then 35 35 echo "Skipped: test '$test' missing in $TRIGGER!" 36 36 exit $KSELFTEST_SKIP_TEST 37 37 fi ··· 80 80 81 81 cat "$LOG" 82 82 # Check for expected output 83 - if egrep -qi "$expect" "$LOG" ; then 83 + if grep -E -qi "$expect" "$LOG" ; then 84 84 echo "$test: saw '$expect': ok" 85 85 exit 0 86 86 else 87 - if egrep -qi XFAIL: "$LOG" ; then 87 + if grep -E -qi XFAIL: "$LOG" ; then 88 88 echo "$test: saw 'XFAIL': [SKIP]" 89 89 exit $KSELFTEST_SKIP_TEST 90 90 else