diff mbox series

[2/2] selftests/lkdtm: Use grep -E instead of egrep

Message ID 20200508065356.2493343-2-mpe@ellerman.id.au (mailing list archive)
State Mainlined
Commit 851c4df54dc1bcae41d07e46e3d89e035b0a7140
Headers show
Series [1/2] selftests/lkdtm: Don't clear dmesg when running tests | expand

Commit Message

Michael Ellerman May 8, 2020, 6:53 a.m. UTC
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>
---
 tools/testing/selftests/lkdtm/run.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Kees Cook May 8, 2020, 7:30 a.m. UTC | #1
On Fri, May 08, 2020 at 04:53:56PM +1000, Michael Ellerman wrote:
> 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>
diff mbox series

Patch

diff --git a/tools/testing/selftests/lkdtm/run.sh b/tools/testing/selftests/lkdtm/run.sh
index 0b409e187c7b..ee64ff8df8f4 100755
--- a/tools/testing/selftests/lkdtm/run.sh
+++ b/tools/testing/selftests/lkdtm/run.sh
@@ -25,13 +25,13 @@  fi
 # Figure out which test to run from our script name.
 test=$(basename $0 .sh)
 # Look up details about the test from master list of LKDTM tests.
-line=$(egrep '^#?'"$test"'\b' tests.txt)
+line=$(grep -E '^#?'"$test"'\b' tests.txt)
 if [ -z "$line" ]; then
 	echo "Skipped: missing test '$test' in tests.txt"
 	exit $KSELFTEST_SKIP_TEST
 fi
 # Check that the test is known to LKDTM.
-if ! egrep -q '^'"$test"'$' "$TRIGGER" ; then
+if ! grep -E -q '^'"$test"'$' "$TRIGGER" ; then
 	echo "Skipped: test '$test' missing in $TRIGGER!"
 	exit $KSELFTEST_SKIP_TEST
 fi
@@ -80,11 +80,11 @@  dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$DMESG" -
 
 cat "$LOG"
 # Check for expected output
-if egrep -qi "$expect" "$LOG" ; then
+if grep -E -qi "$expect" "$LOG" ; then
 	echo "$test: saw '$expect': ok"
 	exit 0
 else
-	if egrep -qi XFAIL: "$LOG" ; then
+	if grep -E -qi XFAIL: "$LOG" ; then
 		echo "$test: saw 'XFAIL': [SKIP]"
 		exit $KSELFTEST_SKIP_TEST
 	else