]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Use "grep -E" instead of "egrep"
authorJakub Wilk <jwilk@jwilk.net>
Wed, 7 Sep 2022 15:55:16 +0000 (17:55 +0200)
committerJakub Wilk <jwilk@jwilk.net>
Wed, 7 Sep 2022 15:55:16 +0000 (17:55 +0200)
The egrep command has been deprecated since GNU grep 2.5.3
(released in 2007). In GNU grep 3.8, it issues an obsolescence warning:
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d4

Use portable "grep -E" instead.

tests/functions.sh
tests/ts/look/separator
tests/ts/mount/remount

index e24d5c87984d94787d605fe403613f3f9ccd485b..216b66e64a151cd2c0345edeb2f8000e7ac44b0c 100644 (file)
@@ -742,7 +742,7 @@ function ts_device_has {
 
 function ts_is_uuid()
 {
-       printf "%s\n" "$1" | egrep -q '^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$'
+       printf "%s\n" "$1" | grep -E -q '^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$'
        return $?
 }
 
index c6028e3147943764d82d57c63c590164feed2e3a..2a5ecf3074562261508edab6c51de0697f9b1dea 100755 (executable)
@@ -22,8 +22,8 @@
 #
 # for example:
 #
-#      cat words.raw | egrep --invert-match "'s$" | \
-#              egrep  "^[[:alnum:]'&!,./-]+$" | \
+#      cat words.raw | grep -E --invert-match "'s$" | \
+#              grep -E "^[[:alnum:]'&!,./-]+$" | \
 #              sort --ignore-case --dictionary-order | \
 #              uniq >  words
 #
index 468d5d30b2a828c40c609b5740a8f5ee6c45bde6..827436cb88504c7eb7aedd1dcdef5f75c81589d5 100755 (executable)
@@ -42,7 +42,7 @@ mkfs.ext2 $DEVICE &> /dev/null || ts_die "Cannot make ext2 on $DEVICE"
 $TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT || ts_die "Cannot mount $TS_MOUNTPOINT"
 
 # check the mount
-egrep -q "^$DEVICE $TS_MOUNTPOINT" $MTAB_FILE \
+grep -E -q "^$DEVICE $TS_MOUNTPOINT" $MTAB_FILE \
  || ts_die "Cannot find $TS_MOUNTPOINT in $MTAB_FILE"
 
 # remount