]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
egrep, fgrep: deprecated
authorMurphy Zhou <jencce.kernel@gmail.com>
Tue, 20 Sep 2022 03:19:50 +0000 (11:19 +0800)
committerZorro Lang <zlang@kernel.org>
Tue, 20 Sep 2022 07:36:51 +0000 (15:36 +0800)
Since this grep commit:
commit a9515624709865d480e3142fd959bccd1c9372d1
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Sun Aug 15 10:52:13 2021 -0700

    egrep, fgrep: now obsolete

egrep will trigger a warning like:
+egrep: warning: egrep is obsolescent; using grep -E

This will break many gold output.

Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
43 files changed:
check
common/btrfs
common/dmlogwrites
common/dump
common/encrypt
common/filter
common/fuzzy
common/populate
common/quota
common/rc
common/repair
common/xfs
tests/btrfs/011
tests/btrfs/100
tests/btrfs/101
tests/btrfs/187
tests/btrfs/252
tests/ext4/006
tests/generic/164
tests/generic/165
tests/generic/454
tests/generic/670
tests/xfs/008
tests/xfs/012
tests/xfs/033
tests/xfs/064
tests/xfs/065
tests/xfs/083
tests/xfs/122
tests/xfs/138
tests/xfs/185
tests/xfs/186
tests/xfs/293
tests/xfs/330
tests/xfs/422
tests/xfs/499
tests/xfs/505
tests/xfs/514
tests/xfs/515
tests/xfs/517
tests/xfs/520
tests/xfs/530
tests/xfs/539

diff --git a/check b/check
index 000e31cb2673ed3182fdb52d95a6b7670eb6eb48..af23572ccc4c7f496f708ec9a316d885dece7083 100755 (executable)
--- a/check
+++ b/check
@@ -389,7 +389,7 @@ if $have_test_arg; then
                                test_name=`basename $t`
                                group_file=$SRC_DIR/$test_dir/group.list
 
-                               if egrep -q "^$test_name" $group_file; then
+                               if grep -Eq "^$test_name" $group_file; then
                                        # in group file ... OK
                                        echo $SRC_DIR/$test_dir/$test_name \
                                                >>$tmp.arglist
index bd2639bf814b0cd44611b36453404da277670db8..d27d33844a4640e824baab5ac9e0d94c3b6d76a9 100644 (file)
@@ -9,7 +9,7 @@ _btrfs_get_subvolid()
        mnt=$1
        name=$2
 
-       $BTRFS_UTIL_PROG sub list $mnt | egrep "\s$name$" | $AWK_PROG '{ print $2 }'
+       $BTRFS_UTIL_PROG sub list $mnt | grep -E "\s$name$" | $AWK_PROG '{ print $2 }'
 }
 
 # _require_btrfs_command <command> [<subcommand>|<option>]
@@ -183,7 +183,7 @@ _check_btrfs_filesystem()
 
 _require_btrfs_dev_del_by_devid()
 {
-       $BTRFS_UTIL_PROG device delete --help | egrep devid > /dev/null 2>&1
+       $BTRFS_UTIL_PROG device delete --help | grep -E devid > /dev/null 2>&1
        [ $? -eq 0 ] || _notrun "$BTRFS_UTIL_PROG too old "\
                        "(must support 'btrfs device delete <devid> /<mnt>')"
 }
index 66c57e2bdfe9da8614c97bbd20f9429917a3ac4f..9fa1c9775ba005264ad10e03131c81c0916aad88 100644 (file)
@@ -51,7 +51,7 @@ _require_log_writes_dax_mountopt()
        # Check options to be sure.
        # XFS ignores dax option(or changes it to dax=never)
        # and goes on if dev underneath does not support dax.
-       _fs_options $LOGWRITES_DMDEV | egrep -q "dax(=always|,|$)"
+       _fs_options $LOGWRITES_DMDEV | grep -Eq "dax(=always|,|$)"
        ret=$?
        _log_writes_cleanup
        if [ $ret -ne 0 ]; then
index 0dcc9655d328345a1789a4757657752282e5e480..8e0446d90c60f44cd0eb466bdd552e2499d40711 100644 (file)
@@ -128,7 +128,7 @@ _check_onl()
     fi
 
 
-    if egrep -i 'onl|ready' $tmp.status | grep -iv 'not ready' >/dev/null; then
+    if grep -Ei 'onl|ready' $tmp.status | grep -iv 'not ready' >/dev/null; then
        :
     else
        echo "ERROR: $dumptape is not online"
@@ -145,7 +145,7 @@ _wait_tape()
     i=0
     while [ $i -lt 20 ]; do
         echo "Checking status..." >>$seqres.full
-       if _mt status 2>&1 | tee -a $seqres.full | egrep -i "onl|ready" >/dev/null; then
+       if _mt status 2>&1 | tee -a $seqres.full | grep -Ei "onl|ready" >/dev/null; then
            break;
        else
            sleep 1
index f84f68b2f7f9916f09667588ec5039091521a51d..45ce0954a18545d08508241693421f1b7439cbe8 100644 (file)
@@ -49,7 +49,7 @@ _require_scratch_encryption()
        # some older kernels and is ext4-specific anyway.)
        mkdir $SCRATCH_MNT/tmpdir
        if _set_encpolicy $SCRATCH_MNT/tmpdir 2>&1 >>$seqres.full | \
-               egrep -q 'Inappropriate ioctl for device|Operation not supported'
+               grep -Eq 'Inappropriate ioctl for device|Operation not supported'
        then
                _notrun "kernel does not support $FSTYP encryption"
        fi
@@ -125,7 +125,7 @@ _require_encryption_policy_support()
                local keyspec=$(_generate_session_encryption_key)
        fi
        if _set_encpolicy $dir $keyspec $set_encpolicy_args \
-               2>&1 >>$seqres.full | egrep -q 'Invalid argument'; then
+               2>&1 >>$seqres.full | grep -Eq 'Invalid argument'; then
                _notrun "kernel does not support encryption policy: '$set_encpolicy_args'"
        fi
        # fscrypt allows setting policies with modes it knows about, even
index 28dea64662dc468a38deb899928a04fb2d8eb08d..6433a30e53c2defb3cef96e56dce8c929228891c 100644 (file)
@@ -347,7 +347,7 @@ _filter_size_to_bytes()
 # verbose output
 _filter_fstrim()
 {
-       egrep -o "[0-9]+ bytes" | $AWK_PROG '{print $1}'
+       grep -Eo "[0-9]+ bytes" | $AWK_PROG '{print $1}'
 }
 
 # Remove the ending dot appended to mount error message, util-linux 2.30
index 809dee5465c2d16df903b8004cd240219baf56f4..b4fda6f5333ad33d8480aac013d20faff19bc949 100644 (file)
@@ -91,11 +91,11 @@ __filter_xfs_db_print_fields() {
                else
                        echo "${fuzzkey}"
                fi
-       done | egrep "${filter}"
+       done | grep -E "${filter}"
 }
 
 # Navigate to some part of the filesystem and print the field info.
-# The first argument is an egrep filter for the fields
+# The first argument is an grep filter for the fields
 # The rest of the arguments are xfs_db commands to locate the metadata.
 _scratch_xfs_list_metadata_fields() {
        filter="$1"
@@ -289,7 +289,7 @@ _scratch_xfs_list_fuzz_verbs() {
 }
 
 # Fuzz some of the fields of some piece of metadata
-# The first argument is an egrep filter for the field names
+# The first argument is an grep filter for the field names
 # The second argument is the repair mode (online, offline, both)
 # The rest of the arguments are xfs_db commands to locate the metadata.
 #
index 867776cdd189bf6184cc058692f1cd5d52e3ff47..9739ac99e0533a9153933e0027ec4722f80fd08a 100644 (file)
@@ -132,7 +132,7 @@ _populate_xfs_qmount_option()
        # Inject our quota mount options
        if echo "${MOUNT_OPTIONS}" | grep -q "${quota}"; then
                return
-       elif echo "${MOUNT_OPTIONS}" | egrep -q '(quota|noenforce)'; then
+       elif echo "${MOUNT_OPTIONS}" | grep -Eq '(quota|noenforce)'; then
                _qmount_option "${quota}"
        else
                export MOUNT_OPTIONS="$MOUNT_OPTIONS -o ${quota}"
index 3a758e0f701b226169a617f8f43a072f1bc36262..22be3c6948a731bd350f9885bae4b30534294ab3 100644 (file)
@@ -141,7 +141,7 @@ _require_nobody()
     _cat_passwd | grep -q '^nobody'
     [ $? -ne 0 ] && _notrun "password file does not contain user nobody."
 
-    _cat_group | egrep -q '^no(body|group)'
+    _cat_group | grep -Eq '^no(body|group)'
     [ $? -ne 0 ] && _notrun "group file does not contain nobody/nogroup."
 }
 
@@ -192,7 +192,7 @@ _choose_uid()
 
 _choose_gid()
 {
-    _cat_group | egrep '^no(body|group)' | perl -ne '@a = split(/:/); END { printf "id=%d name=%s\n", $a[2],$a[0] }'
+    _cat_group | grep -E '^no(body|group)' | perl -ne '@a = split(/:/); END { printf "id=%d name=%s\n", $a[2],$a[0] }'
 }
 
 _choose_prid()
@@ -323,12 +323,12 @@ _check_quota_usage()
 
 # Report the block usage of root, $qa_user, and nobody
 _report_quota_blocks() {
-       repquota $1 | egrep "^($qa_user|root|nobody)" | awk '{print $1, $3, $4, $5}' | sort -r
+       repquota $1 | grep -E "^($qa_user|root|nobody)" | awk '{print $1, $3, $4, $5}' | sort -r
 }
 
 # Report the inode usage of root, $qa_user, and nobody
 _report_quota_inodes() {
-       repquota $1 | egrep "^($qa_user|root|nobody)" | awk '{print $1, $6, $7, $8}' | sort -r
+       repquota $1 | grep -E "^($qa_user|root|nobody)" | awk '{print $1, $6, $7, $8}' | sort -r
 }
 
 # Determine which type of quota we're using
index a25cbcd0911e2287af8acb98435476fc99e47ae6..07c4803a12f3e003f5a9cc93e9737047c50805db 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -113,7 +113,7 @@ _get_hugepagesize()
 {
        local hugepgsz=$(awk '/Hugepagesize/ {print $2}' /proc/meminfo)
        # Call _notrun if $hugepgsz is not a number
-       echo "$hugepgsz" | egrep -q ^[0-9]+$ || \
+       echo "$hugepgsz" | grep -E -q ^[0-9]+$ || \
                _notrun "Cannot get the value of Hugepagesize"
        echo $((hugepgsz * 1024))
 }
@@ -959,7 +959,7 @@ _scratch_mkfs_sized()
        case $FSTYP in
        xfs)
                # don't override MKFS_OPTIONS that set a block size.
-               echo $MKFS_OPTIONS |egrep -q "b?size="
+               echo $MKFS_OPTIONS |grep -E -q "b?size="
                if [ $? -eq 0 ]; then
                        _scratch_mkfs_xfs -d size=$fssize $rt_ops
                else
@@ -1051,13 +1051,13 @@ _scratch_mkfs_geom()
 
     case $FSTYP in
     xfs)
-       if echo "$MKFS_OPTIONS" | egrep -q "b?size="; then
+       if echo "$MKFS_OPTIONS" | grep -E -q "b?size="; then
                MKFS_OPTIONS=$(echo "$MKFS_OPTIONS" | sed -r "s/(b?size=)[0-9]+k?/\1$blocksize/")
        else
                MKFS_OPTIONS+=" -b size=$blocksize"
        fi
 
-       if echo "$MKFS_OPTIONS" | egrep -q "(su|sunit|sw|swidth)="; then
+       if echo "$MKFS_OPTIONS" | grep -E -q "(su|sunit|sw|swidth)="; then
                MKFS_OPTIONS=$(echo "$MKFS_OPTIONS" | sed -r \
                        -e "s/(su|sunit)=[0-9kmg]+/su=$sunit_bytes/" \
                        -e "s/(sw|swidth)=[0-9kmg]+/sw=$swidth_mult/")
@@ -1559,7 +1559,7 @@ _require_scratch_nocheck()
 {
     case "$FSTYP" in
        glusterfs)
-               echo $SCRATCH_DEV | egrep -q ":/?" > /dev/null 2>&1
+               echo $SCRATCH_DEV | grep -E -q ":/?" > /dev/null 2>&1
                if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]; then
                        _notrun "this test requires a valid \$SCRATCH_DEV"
                fi
@@ -1759,7 +1759,7 @@ _require_test()
 {
     case "$FSTYP" in
        glusterfs)
-               echo $TEST_DEV | egrep -q ":/?" > /dev/null 2>&1
+               echo $TEST_DEV | grep -E -q ":/?" > /dev/null 2>&1
                if [ -z "$TEST_DEV" -o "$?" != "0" ]; then
                        _notrun "this test requires a valid \$TEST_DEV"
                fi
@@ -2026,7 +2026,7 @@ __scratch_uses_fsdax()
 {
        local ops=$(_normalize_mount_options "$MOUNT_OPTIONS")
 
-       echo $ops | egrep -qw "dax(=always| |$)" && return 0
+       echo $ops | grep -E -qw "dax(=always| |$)" && return 0
        return 1
 }
 
@@ -2460,7 +2460,7 @@ _require_xfs_io_command()
                # Test xfs_io chattr support AND
                # filesystem FS_IOC_FSSETXATTR support
                # 'tPnE' flags are only valid for a directory so check them on a directory.
-               if echo "$param" | egrep -q 't|P|n|E'; then
+               if echo "$param" | grep -E -q 't|P|n|E'; then
                        testio=`$XFS_IO_PROG -F -c "chattr +$param" $testdir 2>&1`
                        attr_info=`$XFS_IO_PROG -F -r -c "lsattr" $testdir | awk '{print $1}'`
                        $XFS_IO_PROG -F -r -c "chattr -$param" $testdir 2>&1
@@ -2518,7 +2518,7 @@ _require_xfs_io_command()
        "-T")
                # Check O_TMPFILE support in xfs_io, kernel and fs
                testio=`$XFS_IO_PROG -T -c quit $TEST_DIR 2>&1`
-               echo $testio | egrep -q "invalid option|Is a directory" && \
+               echo $testio | grep -E -q "invalid option|Is a directory" && \
                        _notrun "xfs_io $command support is missing"
                echo $testio | grep -q "Operation not supported" && \
                        _notrun "O_TMPFILE is not supported"
@@ -3050,7 +3050,7 @@ _check_generic_filesystem()
 # Filter the knowen errors the UDF Verifier reports.
 _udf_test_known_error_filter()
 {
-       egrep -v "PVD  60  Error: Interchange Level: 1, Maximum Interchange Level: 0|FSD  28  Error: Interchange Level: 1, Maximum Interchange Level: 1,|PVD  72  Warning: Volume Set Identifier: \"\*IRIX UDF\",|Warning: [0-9]+ unused blocks NOT marked as unallocated."
+       grep -E -v "PVD  60  Error: Interchange Level: 1, Maximum Interchange Level: 0|FSD  28  Error: Interchange Level: 1, Maximum Interchange Level: 1,|PVD  72  Warning: Volume Set Identifier: \"\*IRIX UDF\",|Warning: [0-9]+ unused blocks NOT marked as unallocated."
 
 }
 
@@ -3082,9 +3082,9 @@ _check_udf_filesystem()
 
     rm -f $seqres.checkfs
     sleep 1 # Due to a problem with time stamps in udf_test
-    $here/src/udf_test $opt_arg $device | tee $seqres.checkfs | egrep "Error|Warning" | \
+    $here/src/udf_test $opt_arg $device | tee $seqres.checkfs | grep -E "Error|Warning" | \
        _udf_test_known_error_filter | \
-       egrep -iv "Error count:.*[0-9]+.*total occurrences:.*[0-9]+|Warning count:.*[0-9]+.*total occurrences:.*[0-9]+" && \
+       grep -E -iv "Error count:.*[0-9]+.*total occurrences:.*[0-9]+|Warning count:.*[0-9]+.*total occurrences:.*[0-9]+" && \
         echo "Warning UDF Verifier reported errors see $seqres.checkfs." && return 1
     return 0
 }
@@ -3615,7 +3615,7 @@ _check_scratch_dax_mountopt()
 
        _try_scratch_mount "-o $option" > /dev/null 2>&1 || return 1
 
-       if _fs_options $SCRATCH_DEV | egrep -q "dax(=always|,|$)"; then
+       if _fs_options $SCRATCH_DEV | grep -E -q "dax(=always|,|$)"; then
                _scratch_unmount
                return 0
        else
@@ -3881,9 +3881,9 @@ _exclude_mount_option()
        shift
        while [ $# -gt 0 ]; do
                local pattern=$1
-               echo "$pattern" | egrep -q "dax(=always|$)" && \
+               echo "$pattern" | grep -E -q "dax(=always|$)" && \
                        pattern="dax(=always| |$)"
-               if echo $mnt_opts | egrep -q "$pattern"; then
+               if echo $mnt_opts | grep -E -q "$pattern"; then
                        _notrun "mount option \"$1\" not allowed in this test"
                fi
                shift
@@ -4162,7 +4162,7 @@ _dmesg_since_test_start()
 # _dmesg_since_test_start.
 _check_dmesg_for()
 {
-       _dmesg_since_test_start | egrep -q "$1"
+       _dmesg_since_test_start | grep -E -q "$1"
 }
 
 # Default filter for dmesg scanning.
@@ -4176,7 +4176,7 @@ _check_dmesg_filter()
 
        test -e "$filter_file" && extra_filter="-f $filter_file"
 
-       egrep -v -e "BUG: MAX_LOCKDEP_CHAIN_HLOCKS too low" \
+       grep -E -v -e "BUG: MAX_LOCKDEP_CHAIN_HLOCKS too low" \
                -e "BUG: MAX_STACK_TRACE_ENTRIES too low" \
                $extra_filter
 }
@@ -4206,7 +4206,7 @@ _check_dmesg()
        local filter=${1:-_check_dmesg_filter}
 
        _dmesg_since_test_start | $filter >$seqres.dmesg
-       egrep -q -e "kernel BUG at" \
+       grep -E -q -e "kernel BUG at" \
             -e "WARNING:" \
             -e "\bBUG:" \
             -e "Oops:" \
index 463ef9db6e5bdf627c0f608cbdc3235329ec7f35..8945d0028c47a4d16c4b64407398c01a1bab3efc 100644 (file)
@@ -105,7 +105,7 @@ _filter_repair_lostblocks() {
 
 _filter_dd()
 {
-       fgrep -v records        # lose records in/out lines
+       grep -F -v records      # lose records in/out lines
 }
 
 # do some controlled corrupting & ensure repair recovers us
index ae81b3fe45e0e6f785e4bc9ac82315399f0a081e..170dd621a107679397aef217298257ecbf9a8482 100644 (file)
@@ -103,7 +103,7 @@ _scratch_find_xfs_min_logblocks()
        # try again without MKFS_OPTIONS because that's what _scratch_do_mkfs
        # will do if we pass in the log size option.
        if [ $mkfs_status -ne 0 ] &&
-          ! egrep -q '(log size.*too small, minimum|external log device.*too small, must be)' $tmp.mkfserr; then
+          ! grep -E -q '(log size.*too small, minimum|external log device.*too small, must be)' $tmp.mkfserr; then
                eval "$mkfs_cmd $extra_mkfs_options $SCRATCH_DEV" \
                        2>$tmp.mkfserr 1>$tmp.mkfsstd
                mkfs_status=$?
@@ -181,7 +181,7 @@ _xfs_get_file_block_size()
 {
        local path="$1"
 
-       if ! ($XFS_IO_PROG -c "stat -v" "$path" 2>&1 | egrep -q '(rt-inherit|realtime)'); then
+       if ! ($XFS_IO_PROG -c "stat -v" "$path" 2>&1 | grep -E -q '(rt-inherit|realtime)'); then
                _get_block_size "$path"
                return
        fi
@@ -1025,8 +1025,8 @@ _scratch_xfs_set_metadata_field()
        done
 
        local wr_cmd="write"
-       _scratch_xfs_db -x -c "help write" | egrep -q "(-c|-d)" && value="-- ${value}"
-       _scratch_xfs_db -x -c "help write" | egrep -q "(-d)" && wr_cmd="${wr_cmd} -d"
+       _scratch_xfs_db -x -c "help write" | grep -E -q "(-c|-d)" && value="-- ${value}"
+       _scratch_xfs_db -x -c "help write" | grep -E -q "(-d)" && wr_cmd="${wr_cmd} -d"
        _scratch_xfs_db -x "${cmds[@]}" -c "${wr_cmd} ${key} ${value}"
 }
 
@@ -1166,8 +1166,8 @@ _force_xfsv4_mount_options()
        local pquota=0
 
        # Can't have group and project quotas in XFS v4
-       echo "$MOUNT_OPTIONS" | egrep -q "(gquota|grpquota|grpjquota=|gqnoenforce)" && gquota=1
-       echo "$MOUNT_OPTIONS" | egrep -q "(\bpquota|prjquota|pqnoenforce)" && pquota=1
+       echo "$MOUNT_OPTIONS" | grep -E -q "(gquota|grpquota|grpjquota=|gqnoenforce)" && gquota=1
+       echo "$MOUNT_OPTIONS" | grep -E -q "(\bpquota|prjquota|pqnoenforce)" && pquota=1
 
        if [ $gquota -gt 0 ] && [ $pquota -gt 0 ]; then
                export MOUNT_OPTIONS=$(echo $MOUNT_OPTIONS \
index 0665e12627ae8ccf4d6f12aeb5c98d8d58133512..6c3d037f84f7c01b00d634ef7fc2c3d067debd1e 100755 (executable)
@@ -133,7 +133,7 @@ workout()
        _run_btrfs_util_prog filesystem show -m $SCRATCH_MNT
 
        # Skip -r test for configs without mirror OR replace cancel
-       if echo $mkfs_options | egrep -qv "raid1|raid5|raid6|raid10" || \
+       if echo $mkfs_options | grep -E -qv "raid1|raid5|raid6|raid10" || \
           [ "${with_cancel}Q" = "cancelQ" ]; then
                _scratch_unmount > /dev/null 2>&1
                _scratch_dev_pool_put
index 9986a06e1d109d73ce16bd9ab0efce53a2708e0a..410e83ba176194f8409ef2f1416f76866f81559d 100755 (executable)
@@ -37,7 +37,7 @@ _run_btrfs_util_prog filesystem show -m $SCRATCH_MNT
 $BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | _filter_btrfs_filesystem_show
 
 error_devid=`$BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT |\
-                       egrep $DMERROR_DEV | $AWK_PROG '{print $2}'`
+                       grep -E $DMERROR_DEV | $AWK_PROG '{print $2}'`
 
 snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT"
 snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`"
index f0436f9f508221acd7c96e8f8c6d863986fbdab0..e8ed8c5c735133fe19668f3b9a756fb535d6c506 100755 (executable)
@@ -38,7 +38,7 @@ _run_btrfs_util_prog filesystem show -m $SCRATCH_MNT
 $BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | _filter_btrfs_filesystem_show
 
 error_devid=`$BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT |\
-                       egrep $DMERROR_DEV | $AWK_PROG '{print $2}'`
+                       grep -E $DMERROR_DEV | $AWK_PROG '{print $2}'`
 
 snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT"
 snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`"
index 574636a61313789f5ae4d1bea51c362c7dfb7167..d3cf05a1bd92f5d6402c40bcb704536299de4e4c 100755 (executable)
@@ -219,7 +219,7 @@ wait $balance_pid
 # BTRFS error (device sdc): parent transid verify failed on 32243712 wanted 24 \
 #     found 27
 #
-_dmesg_since_test_start | egrep -e '\bBTRFS error \(device .*?\):'
+_dmesg_since_test_start | grep -E -e '\bBTRFS error \(device .*?\):'
 
 status=0
 exit
index 65ebe5713ddbc59911c49485927ccc429f1b3cd8..8b4809b7481e0c504a300013ed72948f6d9f66f8 100755 (executable)
@@ -180,7 +180,7 @@ for i in "${!snapshots[@]}"; do
        # case, so we don't have a mismatch with the golden output in case we
        # run with a non default $LOAD_FACTOR (default is 1). We only want the
        # mismatch with the golden output in case there's a checksum failure.
-       $FSSUM_PROG -r "$snap_csum" "$snap_copy" | egrep -v '^OK$'
+       $FSSUM_PROG -r "$snap_csum" "$snap_copy" | grep -E -v '^OK$'
 done
 
 echo "Silence is golden"
index 48ed6bee967ebe8e5548b987bdf85d4e53c3b897..8792167bd9c2c12fd38b434043cc6a031782aa00 100755 (executable)
@@ -130,7 +130,7 @@ cat "$ROUND2_LOG" >> $seqres.full
 echo "++ check fs (2)" >> $seqres.full
 _check_scratch_fs >> $seqres.full 2>&1
 
-egrep -q '(did not fix|makes no progress)' $seqres.full && echo "e2fsck failed" | tee -a $seqres.full
+grep -E -q '(did not fix|makes no progress)' $seqres.full && echo "e2fsck failed" | tee -a $seqres.full
 if [ "$(wc -l < "$ROUND2_LOG")" -ne 8 ]; then
        echo "e2fsck did not fix everything" | tee -a $seqres.full
 fi
index 56c05e3774b8c119208584242598b1e62ca0d409..8ab71c72b0992a10df239baac46cbf41bd3daf71 100755 (executable)
@@ -50,7 +50,7 @@ _cp_reflink $testdir/file1 $testdir/file3
 _scratch_cycle_mount
 
 fbytes() {
-       egrep -v '(61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61|62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62)'
+       grep -E -v '(61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61|62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62)'
 }
 
 reader() {
index bc24bcabf305a547a3ebcb9bd19624fb83715e4a..6deb6623582240a2cad7e28ec1e90f2025ecd7fd 100755 (executable)
@@ -51,7 +51,7 @@ _cp_reflink $testdir/file1 $testdir/file3
 _scratch_cycle_mount
 
 fbytes() {
-       egrep -v '(61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61|62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62)'
+       grep -E -v '(61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61|62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62)'
 }
 
 reader() {
index 133e2e9d4a30dc5655cc619dc3534d79b6a242fd..3c9b39d059532d2de30caf22b8f1faa32b7c3a38 100755 (executable)
@@ -168,7 +168,7 @@ testf "combmark_\xe1\x80\x9c\xe1\x80\xad\xe1\x80\xaf.txt" "combining marks"
 testf "combmark_\xe1\x80\x9c\xe1\x80\xaf\xe1\x80\xad.txt" "combining marks"
 
 echo "Uniqueness of keys?"
-crazy_keys="$(_getfattr --absolute-names -d "${testfile}" | egrep -c '(french_|chinese_|greek_|arabic_|urk)')"
+crazy_keys="$(_getfattr --absolute-names -d "${testfile}" | grep -E -c '(french_|chinese_|greek_|arabic_|urk)')"
 expected_keys=11
 test "${crazy_keys}" -ne "${expected_keys}" && echo "Expected ${expected_keys} keys, saw ${crazy_keys}."
 
index 4a895d90670a6d90cafde6f9047640fdee39d1c2..67de167405e96f43751219b38f9e62728ec0f672 100755 (executable)
@@ -43,7 +43,7 @@ fbytes() {
        # Different with generic/164,165, mread copies data from mmapped area
        # one-byte-at-a-time, which may cause races during reflink_range().
        # So the result of _mread_range() may be a mix of 61 and 62.
-       egrep -v '((61|62) ){15}(61|62)'
+       grep -E -v '((61|62) ){15}(61|62)'
 }
 
 reader() {
index a53f6c9296f525b1acf5dccd6c3a4e44021b8cdd..e7d6153b2ace97c2445b091e1731e06d6c27aa13 100755 (executable)
@@ -46,7 +46,7 @@ _do_test()
                echo "holes is in range"
        else
                # quick check - how many holes did we get?
-               count=`xfs_bmap $out | egrep -c ': hole'`
+               count=`xfs_bmap $out | grep -E -c ': hole'`
                # blocks can end up adjacent, therefore number of holes varies
                _within_tolerance "holes" $count $_holes 10% -v
        fi
index 5ebc9058127887153e604319c6967d6b7e5d156d..e0dccc4e428104978945cf7bd29390f403deb683 100755 (executable)
@@ -50,7 +50,7 @@ _do_test()
     if [ $failed -eq 0 ]
     then        
         # quick check - how many holes did we get?
-        count=`xfs_bmap $out | egrep -c ': hole'`
+        count=`xfs_bmap $out | grep -E -c ': hole'`
         echo "    $count hole(s) detected"
         # and how big was the file?
         _filesize $out
index d47da0d646bafbb0c79fb8e82150fff68993d053..ef5dc4fa367e658f5324fb203428969f87d66bc6 100755 (executable)
@@ -45,7 +45,7 @@ _check_root_inos()
 #
 _filter_bad_ids()
 {
-       egrep -v 'bad user id 0xffffffff|bad group id 0xffffffff'
+       grep -E -v 'bad user id 0xffffffff|bad group id 0xffffffff'
 }
 
 # real QA test starts here
index a81b226b0be18374629a3e684c19f61366ea418b..f67c29fd4b9ffbe0ac18a31f832a50cbb80e5fb6 100755 (executable)
@@ -31,7 +31,7 @@ _ls_size_filter()
     # Filter out the housekeeping files of xfsrestore
     #
     $AWK_PROG 'NF == 9 { print $5, $9 }' |\
-    egrep -v 'dumpdir|housekeeping|dirattr|dirextattr|namreg|state|tree' 
+    grep -E -v 'dumpdir|housekeeping|dirattr|dirextattr|namreg|state|tree'
 }
 
 # real QA test starts here
@@ -48,7 +48,7 @@ while [ $i -le 9 ]; do
     if [ $i -gt 0 ]; then
        sleep 2
        _modify_level $i
-    fi 
+    fi
 
     _stable_fs
     sleep 2
index 8485dee6a1d8287e5c266469855ffe6e2d3d4513..819d385eaec357d92d69ae6987fe5fa3a5675a50 100755 (executable)
@@ -37,7 +37,7 @@ _list_dir()
     find $__dir  -exec $here/src/lstat64 -t {} \; |\
     sed -e 's/.*dumpdir/dumpdir/' -e '/^dumpdir /d' |\
     sed -e 's/.*restoredir/restoredir/' -e '/^restoredir /d' |\
-    egrep -v 'housekeeping|dirattr|dirextattr|namreg|state|tree' |\
+    grep -E -v 'housekeeping|dirattr|dirextattr|namreg|state|tree' |\
     awk '$3 ~ /^d/ { $2 = "XXX" } {print}' |\
     LC_COLLATE=POSIX sort
 } 
index a9acc9f560eefa03f7fc2759487b5107cb9af8fb..edab3b7b092222cf5800eccff2bf2182f70fd6f9 100755 (executable)
@@ -145,7 +145,7 @@ cat "$ROUND2_LOG" >> $seqres.full
 echo "++ check fs (2)" >> $seqres.full
 _repair_scratch_fs >> $seqres.full 2>&1
 
-egrep -q '(did not fix|makes no progress)' $seqres.full && echo "xfs_repair failed" | tee -a $seqres.full
+grep -E -q '(did not fix|makes no progress)' $seqres.full && echo "xfs_repair failed" | tee -a $seqres.full
 if [ "$(wc -l < "$ROUND2_LOG")" -ne 8 ]; then
        echo "xfs_repair did not fix everything" | tee -a $seqres.full
 fi
index 18748e67f413631933390ae2ce840b7c5c2cedc9..91083d6036bf8e30d881023311f288a959175397 100755 (executable)
@@ -182,8 +182,8 @@ echo 'int main(int argc, char *argv[]) {' >>$cprog
 #
 cat /usr/include/xfs/xfs*.h | indent |\
 _attribute_filter |\
-egrep '(} *xfs_.*_t|^struct xfs_[a-z0-9_]*$)' |\
-egrep -v -f $tmp.ignore |\
+grep -E '(} *xfs_.*_t|^struct xfs_[a-z0-9_]*$)' |\
+grep -E -v -f $tmp.ignore |\
 sed -e 's/^.*}[[:space:]]*//g' -e 's/;.*$//g' -e 's/_t, /_t\n/g' |\
 sort | uniq |\
 awk '{printf("printf(\"sizeof(%s) = %%zu\\n\", sizeof(%s));\n", $0, $0);}' |\
index 966ac03ad338402ff57367f919a63b2369d08533..c49d2d9ee0d611f5a32dd6eafaa988e9ac1a13f4 100755 (executable)
@@ -33,7 +33,7 @@ echo "Test with interactive"
 (echo "sb 0"; sleep 0.5;
  echo "p magicnum"; sleep 0.5;
  echo "source $tmp.a"; sleep 0.5;
- echo "p magicnum"; sleep 0.5) | _scratch_xfs_db 2>&1 | sed -e 's/xfs_db> //g' -e 's/0x58465342/XFS_MAGIC/g' | egrep '(This is file|magicnum =)'
+ echo "p magicnum"; sleep 0.5) | _scratch_xfs_db 2>&1 | sed -e 's/xfs_db> //g' -e 's/0x58465342/XFS_MAGIC/g' | grep -E '(This is file|magicnum =)'
 
 # success, all done
 status=0
index f0e87642b4eb372c05b1be7c2475f47ce1ffa700..73b210920fda2eda0ef97a1d26439a67b11999bd 100755 (executable)
@@ -108,7 +108,7 @@ expected_end="$(( (alloc_rtx * rtextsize - 1) / 512 ))"
 # file_offset file_end physical_offset physical_end
 rtfile_exts() {
        $XFS_IO_PROG -c 'bmap -elp' $rtfile | \
-               egrep -v '(^/|EXT:|hole)' | \
+               grep -E -v '(^/|EXT:|hole)' | \
                tr ':.[]' '    ' | \
                while read junk foff fend physoff physend junk; do
                        echo "$foff $fend $physoff $physend"
index b54fcf26109b41cc9524bce5a0117ec3a0c0d063..f44158e31ce389022bd573b41dea560b29bb253c 100755 (executable)
@@ -55,8 +55,8 @@ _filter_inode()
 {
        tee -a $seqres.full | \
                sed -e "s/core.forkoff/forkoff/g" | \
-               egrep '^u.sfdir2|^u.sfdir3|^a.sfattr|forkoff' | \
-               egrep -v 'inumber|parent' | \
+               grep -E '^u.sfdir2|^u.sfdir3|^a.sfattr|forkoff' | \
+               grep -E -v 'inumber|parent' | \
                sed -e s/sfdir3/sfdir2/g | \
                grep -v filetype
 }
index 20f8c48689b6459c0b4fc1c39b1723c0dcf9f47c..7a17eb81c43927c303eb5d57f9ae2a366faa02c4 100755 (executable)
@@ -33,7 +33,7 @@ esac
 _require_command "$(type -P $CAT)" $CAT
 
 for COMMAND in `$XFS_IO_PROG -c help | awk '{print $1}' | grep -v "^Use"`; do
-  $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \
+  $CAT "$MANPAGE" | grep -E -q "^\.B.*$COMMAND" || \
        echo "$COMMAND not documented in the xfs_io manpage"
 done
 
index 40be4c46bfcb066e4b3d1934a43a17842303b87f..5a82a1fd19e2af35a4bf1cd7cb129e95c0ed8a97 100755 (executable)
@@ -26,7 +26,7 @@ _require_nobody
 
 do_repquota()
 {
-       repquota $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)' | sort -r
+       repquota $SCRATCH_MNT | grep -E '^(fsgqa|root|nobody)' | sort -r
 }
 
 rm -f "$seqres.full"
index fdbb8bf14c899ffae4ec6e8a43a32a54d102510b..f3c63e8d6a3839b6307b1e80db52fbb5eeba1037 100755 (executable)
@@ -73,7 +73,7 @@ cpus=$(( $($here/src/feature -o) * 4 * LOAD_FACTOR))
 
 echo "Concurrent repair"
 filter_output() {
-       egrep -v '(Device or resource busy|Invalid argument)'
+       grep -E -v '(Device or resource busy|Invalid argument)'
 }
 freeze_loop() {
        end="$1"
index b5597708e6dc94d51a073a58ed106249489e7b1a..9672f95d566e5a590c36ad0e3082569923e4c11e 100755 (executable)
@@ -44,7 +44,7 @@ struct ftrace_chk {
        char                    *str;
 } syms[] = {
 ENDL
-egrep '(__print_flags|__print_symbolic)' $ftrace_dir*/*/format | \
+grep -E '(__print_flags|__print_symbolic)' $ftrace_dir*/*/format | \
        sed -f $sedprog | grep '^{' | sort | uniq >> $cprog
 cat >> $cprog << ENDL
 };
index 71fb6e9d3c45c5c5ea3a3592e1f85d87aa255797..0601b1a85fb4cf589689497a033c9a374fe6f0b9 100755 (executable)
@@ -29,7 +29,7 @@ esac
 _require_command "$(type -P $CAT)" $CAT
 
 for COMMAND in `$XFS_SPACEMAN_PROG -c help $TEST_DIR | awk '{print $1}' | grep -v "^Use"`; do
-  $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \
+  $CAT "$MANPAGE" | grep -E -q "^\.B.*$COMMAND" || \
        echo "$COMMAND not documented in the xfs_spaceman manpage"
 done
 
index cf5588f25619ec28bc643b7fdcf2018be2fe06cb..94f98398f32dbc7de471b27e79e35275785e33f9 100755 (executable)
@@ -41,7 +41,7 @@ truncate -s 128m $file
 $MKFS_XFS_PROG $file >> /dev/null
 
 for COMMAND in `$XFS_DB_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do
-  $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \
+  $CAT "$MANPAGE" | grep -E -q "^\.B.*$COMMAND" || \
        echo "$COMMAND not documented in the xfs_db manpage"
 done
 
index 2d7bbb357768d21b0f7ea2a65744d9d65368e005..adb2bd6f1795d56d34f1abe1a933aeba21174414 100755 (executable)
@@ -37,7 +37,7 @@ esac
 _require_command "$(type -P $CAT)" $CAT
 
 for COMMAND in `$XFS_QUOTA_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do
-  $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \
+  $CAT "$MANPAGE" | grep -E -q "^\.B.*$COMMAND" || \
        echo "$COMMAND not documented in the xfs_quota manpage"
 done
 
index 6877af13bb4e238840e7ee4f6a99b27d74545c35..99fc89b05f972fc7e13e727fac68b7ea6e364473 100755 (executable)
@@ -70,7 +70,7 @@ cpus=$(( $(src/feature -o) * 4 * LOAD_FACTOR))
 
 echo "Concurrent fsmap and freeze"
 filter_output() {
-       egrep -v '(Device or resource busy|Invalid argument)'
+       grep -E -v '(Device or resource busy|Invalid argument)'
 }
 freeze_loop() {
        end="$1"
index 2fceb07c5e28598aa1ed09d38889ce3466e1f665..dd6d845e7af5a0f780f5613c0c55e10b5b8a357e 100755 (executable)
@@ -52,7 +52,7 @@ force_crafted_metadata() {
        fi
 
        _dmesg_since_test_start | tac | sed -ne "0,\#${kmsg}#p" | tac | \
-               egrep -q 'Metadata corruption detected at' && hasmsg=1
+               grep -E -q 'Metadata corruption detected at' && hasmsg=1
 
        _scratch_unmount > /dev/null 2>&1
        [ $mounted -eq 0 -o $hasmsg -eq 1 ] || \
index 9c6f44d76b81f42f5f4837449b514403d932711c..c960738db7f12687f27fce3941d97fce92046f92 100755 (executable)
@@ -73,7 +73,7 @@ _try_scratch_mount || _notrun "Couldn't mount fs with synthetic rt volume"
 formatted_blksz="$(_get_block_size $SCRATCH_MNT)"
 test "$formatted_blksz" -ne "$dbsize" && \
        _notrun "Tried to format with $dbsize blocksize, got $formatted_blksz."
-$XFS_INFO_PROG $SCRATCH_MNT | egrep -q 'realtime.*blocks=0' && \
+$XFS_INFO_PROG $SCRATCH_MNT | grep -E -q 'realtime.*blocks=0' && \
        _notrun "Filesystem should have a realtime volume"
 
 echo "Consume free space"
index 77b44c89244318e01585f1540b6ed4e39cd57a3f..778dce852cae48f2d0763b93a81083be9a8fbbdc 100755 (executable)
@@ -36,7 +36,7 @@ dmesg_since_test_tag()
 
 check_dmesg_for_since_tag()
 {
-       dmesg_since_test_tag | egrep -q "$1"
+       dmesg_since_test_tag | grep -E -q "$1"
 }
 
 echo "Silence is golden."