Skip to content

Commit 851c4df

Browse files
mpeshuahkh
authored andcommitted
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 <[email protected]> Acked-by: Kees Cook <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent f131d9e commit 851c4df

File tree

1 file changed

+4
-4
lines changed
  • tools/testing/selftests/lkdtm

1 file changed

+4
-4
lines changed

tools/testing/selftests/lkdtm/run.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ fi
2525
# Figure out which test to run from our script name.
2626
test=$(basename $0 .sh)
2727
# 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)
2929
if [ -z "$line" ]; then
3030
echo "Skipped: missing test '$test' in tests.txt"
3131
exit $KSELFTEST_SKIP_TEST
3232
fi
3333
# Check that the test is known to LKDTM.
34-
if ! egrep -q '^'"$test"'$' "$TRIGGER" ; then
34+
if ! grep -E -q '^'"$test"'$' "$TRIGGER" ; then
3535
echo "Skipped: test '$test' missing in $TRIGGER!"
3636
exit $KSELFTEST_SKIP_TEST
3737
fi
@@ -80,11 +80,11 @@ dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$DMESG" -
8080

8181
cat "$LOG"
8282
# Check for expected output
83-
if egrep -qi "$expect" "$LOG" ; then
83+
if grep -E -qi "$expect" "$LOG" ; then
8484
echo "$test: saw '$expect': ok"
8585
exit 0
8686
else
87-
if egrep -qi XFAIL: "$LOG" ; then
87+
if grep -E -qi XFAIL: "$LOG" ; then
8888
echo "$test: saw 'XFAIL': [SKIP]"
8989
exit $KSELFTEST_SKIP_TEST
9090
else

0 commit comments

Comments
 (0)