tools: tests: replace egrep with grep -E
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 1 Jun 2023 13:29:45 +0000 (15:29 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 1 Jun 2023 14:03:27 +0000 (16:03 +0200)
Since version 3.11 egrep emits the following warning to stderr on startup:

  egrep: warning: egrep is obsolescent; using grep -E

This makes the tests fail (though that seems to depend on BATS version)
so replace egrep with grep -E as suggested.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
tools/gpio-tools-test
tools/gpio-tools-test.bats

index 5b6c72e5afb8eaa7c0de8a216bad03f73d35551d..ed39ed5a549b07c241a160b5e6f26cf30bb1c720 100755 (executable)
@@ -37,7 +37,7 @@ check_prog() {
 check_prog bats
 check_prog modprobe
 check_prog timeout
-check_prog egrep
+check_prog grep
 
 # Check if we're running a kernel at the required version or later
 check_kernel $MIN_KERNEL_VERSION
index adbce945b94911ef8bfc395793a934061bcc2c68..c83ca7de104b160b59cc864b62202dbaa7faec7a 100755 (executable)
@@ -154,7 +154,7 @@ gpiosim_cleanup() {
                ls $BANKPATH/line* > /dev/null 2>&1
                if [ "$?" = "0" ]
                then
-                       for LINE in $(find $BANKPATH/ | egrep "line[0-9]+$")
+                       for LINE in $(find $BANKPATH/ | grep -E "line[0-9]+$")
                        do
                                test -e $LINE/hog && rmdir $LINE/hog
                                rmdir $LINE