egrep, fgrep: deprecated
PATCH 1/2 egrep, fgrep: deprecated
Since this grep commit:
commit a9515624709865d480e3142fd959bccd1c9372d1 Author: Paul Eggert <[email protected]> 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.
--- check | 2 +- common/btrfs | 4 ++-- common/dmlogwrites | 2 +- common/dump | 4 ++-- common/encrypt | 4 ++-- common/filter | 2 +- common/fuzzy | 6 +++--- common/populate | 2 +- common/quota | 8 ++++---- common/rc | 36 ++++++++++++++++++------------------ common/repair | 2 +- common/xfs | 12 ++++++------ tests/btrfs/011 | 2 +- tests/btrfs/100 | 2 +- tests/btrfs/101 | 2 +- tests/btrfs/187 | 2 +- tests/btrfs/252 | 2 +- tests/ext4/006 | 2 +- tests/generic/164 | 2 +- tests/generic/165 | 2 +- tests/generic/454 | 2 +- tests/generic/670 | 2 +- tests/xfs/008 | 2 +- tests/xfs/012 | 2 +- tests/xfs/033 | 2 +- tests/xfs/064 | 4 ++-- tests/xfs/065 | 2 +- tests/xfs/083 | 2 +- tests/xfs/122 | 4 ++-- tests/xfs/138 | 2 +- tests/xfs/185 | 2 +- tests/xfs/186 | 4 ++-- tests/xfs/293 | 2 +- tests/xfs/330 | 2 +- tests/xfs/422 | 2 +- tests/xfs/499 | 2 +- tests/xfs/505 | 2 +- tests/xfs/514 | 2 +- tests/xfs/515 | 2 +- tests/xfs/517 | 2 +- tests/xfs/520 | 2 +- tests/xfs/530 | 2 +- tests/xfs/539 | 2 +- 43 files changed, 76 insertions(+), 76 deletions(-)
check +1 -1
@@ -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
common/btrfs +2 -2
@@ -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>')" }
common/dmlogwrites +1 -1
@@ -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
common/dump +2 -2
@@ -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
common/encrypt +2 -2
@@ -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
common/filter +1 -1
@@ -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
common/fuzzy +3 -3
@@ -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. #
common/populate +1 -1
@@ -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}"
common/quota +4 -4
@@ -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
common/rc +18 -18
@@ -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)) }
@@ -1080,7 +1080,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
@@ -1165,13 +1165,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/")
@@ -1673,7 +1673,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
@@ -1873,7 +1873,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
@@ -2140,7 +2140,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 }
@@ -2601,7 +2601,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
@@ -2659,7 +2659,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"
@@ -3217,7 +3217,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." }
@@ -3249,9 +3249,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 }
@@ -3782,7 +3782,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
@@ -4048,9 +4048,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
@@ -4329,7 +4329,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.
@@ -4338,7 +4338,7 @@ _check_dmesg_for() # lockdep. _check_dmesg_filter() { - 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" }
@@ -4356,7 +4356,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:" \
common/repair +1 -1
@@ -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
common/xfs +6 -6
@@ -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
@@ -966,8 +966,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}" }
@@ -1107,8 +1107,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 \
tests/btrfs/011 +1 -1
@@ -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
tests/btrfs/100 +1 -1
@@ -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'\`"
tests/btrfs/101 +1 -1
@@ -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'\`"
tests/btrfs/187 +1 -1
@@ -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
tests/btrfs/252 +1 -1
@@ -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"
tests/ext4/006 +1 -1
@@ -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
tests/generic/164 +1 -1
@@ -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() {
tests/generic/165 +1 -1
@@ -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() {
tests/generic/454 +1 -1
@@ -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}."
tests/generic/670 +1 -1
@@ -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() {
tests/xfs/008 +1 -1
@@ -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
tests/xfs/012 +1 -1
@@ -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
tests/xfs/033 +1 -1
@@ -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
tests/xfs/064 +2 -2
@@ -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
tests/xfs/065 +1 -1
@@ -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 }
tests/xfs/083 +1 -1
@@ -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
tests/xfs/122 +2 -2
@@ -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);}' |\
tests/xfs/138 +1 -1
@@ -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
tests/xfs/185 +1 -1
@@ -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"
tests/xfs/186 +2 -2
@@ -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 }
tests/xfs/293 +1 -1
@@ -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
tests/xfs/330 +1 -1
@@ -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"
tests/xfs/422 +1 -1
@@ -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"
tests/xfs/499 +1 -1
@@ -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 };
tests/xfs/505 +1 -1
@@ -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
tests/xfs/514 +1 -1
@@ -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
tests/xfs/515 +1 -1
@@ -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
tests/xfs/517 +1 -1
@@ -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"
tests/xfs/520 +1 -1
@@ -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 ] || \
tests/xfs/530 +1 -1
@@ -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"
tests/xfs/539 +1 -1
@@ -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."
Signature · 1 line
2.31.1
PATCH 2/2 common/quota: fix grep pattern
The second dash is not needed now. Newer grep is complaining:
+grep: warning: stray \ before -
--- common/quota | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/quota +1 -1
@@ -218,7 +218,7 @@ _qmount() quotacheck -ug $SCRATCH_MNT >>$seqres.full 2>&1 quotaon -ug $SCRATCH_MNT >>$seqres.full 2>&1 # try to turn on project quota if it's supported - if quotaon --help 2>&1 | grep -q '\-\-project'; then + if quotaon --help 2>&1 | grep -q '\--project'; then quotaon --project $SCRATCH_MNT >>$seqres.full 2>&1 fi fi
Signature · 1 line
2.31.1
Re: [PATCH 2/2] common/quota: fix grep pattern
Quoted 13 lines · Murphy Zhou
The second dash is not needed now. Newer grep is complaining:
+grep: warning: stray \ before -Signed-off-by Murphy Zhou <[email protected]>--- common/quota | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/quota +0
-0
common/quota _qmount() · line 221
Quoted 5 lines
common/quota +1
-1@@ -218,7 +218,7 @@ _qmount() quotacheck -ug $SCRATCH_MNT >>$seqres.full 2>&1 quotaon -ug $SCRATCH_MNT >>$seqres.full 2>&1 # try to turn on project quota if it's supported - if quotaon --help 2>&1 | grep -q '\-\-project'; then + if quotaon --help 2>&1 | grep -q '\--project'; then
Yeah, I can reproduce the problem [1] you said. But I'm wondering if using "--" [2] might be better to be compatible with old and new grep ?
Thanks,
Zorro
[1]
# quotaon --help 2>&1|grep '\--project' -P, --project operate on project quotas # quotaon --help 2>&1|grep '\-\-project' grep: warning: stray \ before - -P, --project operate on project quotas
[2]
quotaon --help 2>&1 | "grep -q -- '--project'
Quoted 6 lines
common/quota +0
-0quotaon --project $SCRATCH_MNT >>$seqres.full 2>&1 fi fiSignature · 1 line
2.31.1
Re: [PATCH 2/2] common/quota: fix grep pattern
Quoted 10 lines · Zorro Lang
Quoted 8 lines · Murphy Zhou
The second dash is not needed now. Newer grep is complaining:
+grep: warning: stray \ before -Signed-off-by Murphy Zhou <[email protected]>--- common/quota | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
common/quota _qmount() · line 221
Quoted 10 lines
common/quota +1
-1@@ -218,7 +218,7 @@ _qmount() quotacheck -ug $SCRATCH_MNT >>$seqres.full 2>&1 quotaon -ug $SCRATCH_MNT >>$seqres.full 2>&1 # try to turn on project quota if it's supported - if quotaon --help 2>&1 | grep -q '\-\-project'; then + if quotaon --help 2>&1 | grep -q '\--project'; thenYeah, I can reproduce the problem [1] you said. But I'm wondering if using "--" [2] might be better to be compatible with old and new grep ?
Agree! Thanks!
Quoted 21 lines
Thanks,
Zorro[1]
# quotaon --help 2>&1|grep '\--project' -P, --project operate on project quotas # quotaon --help 2>&1|grep '\-\-project' grep: warning: stray \ before - -P, --project operate on project quotas[2]
quotaon --help 2>&1 | "grep -q -- '--project'Quoted 6 lines
common/quota +0
-1quotaon --project $SCRATCH_MNT >>$seqres.full 2>&1 fi fi --2.31.1
Quoted 7 lines · Murphy Zhou
Since this grep commit:
commit a9515624709865d480e3142fd959bccd1c9372d1 Author: Paul Eggert <[email protected]> Date: Sun Aug 15 10:52:13 2021 -0700 egrep, fgrep: now obsolete
Quoted 7 lines
egrep will trigger a warning like:
+egrep: warning: egrep is obsolescent; using grep -EThis will break many gold output.
Signed-off-by Murphy Zhou <[email protected]>---
I've sent a patch for this issue, and it's been reviewed:
https://lore.kernel.org/fstests/20220913125258.exj4iszolctiuxv2@zlang-mailbox/T/#t
Welcome more review points, if you still find more problems after merging it.
Thanks,
Zorro
Quoted 855 lines
check | 2 +- common/btrfs | 4 ++-- common/dmlogwrites | 2 +- common/dump | 4 ++-- common/encrypt | 4 ++-- common/filter | 2 +- common/fuzzy | 6 +++--- common/populate | 2 +- common/quota | 8 ++++---- common/rc | 36 ++++++++++++++++++------------------ common/repair | 2 +- common/xfs | 12 ++++++------ tests/btrfs/011 | 2 +- tests/btrfs/100 | 2 +- tests/btrfs/101 | 2 +- tests/btrfs/187 | 2 +- tests/btrfs/252 | 2 +- tests/ext4/006 | 2 +- tests/generic/164 | 2 +- tests/generic/165 | 2 +- tests/generic/454 | 2 +- tests/generic/670 | 2 +- tests/xfs/008 | 2 +- tests/xfs/012 | 2 +- tests/xfs/033 | 2 +- tests/xfs/064 | 4 ++-- tests/xfs/065 | 2 +- tests/xfs/083 | 2 +- tests/xfs/122 | 4 ++-- tests/xfs/138 | 2 +- tests/xfs/185 | 2 +- tests/xfs/186 | 4 ++-- tests/xfs/293 | 2 +- tests/xfs/330 | 2 +- tests/xfs/422 | 2 +- tests/xfs/499 | 2 +- tests/xfs/505 | 2 +- tests/xfs/514 | 2 +- tests/xfs/515 | 2 +- tests/xfs/517 | 2 +- tests/xfs/520 | 2 +- tests/xfs/530 | 2 +- tests/xfs/539 | 2 +- 43 files changed, 76 insertions(+), 76 deletions(-)check +1
-1@@ -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.arglistcommon/btrfs +2
-2@@ -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>')" }common/dmlogwrites +1
-1@@ -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 ]; thencommon/dump +2
-2@@ -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 1common/encrypt +2
-2@@ -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, evencommon/filter +1
-1@@ -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.30common/fuzzy +3
-3@@ -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. #common/populate +1
-1@@ -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}"common/quota +4
-4@@ -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 usingcommon/rc +18
-18@@ -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)) }@@ -1080,7 +1080,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@@ -1165,13 +1165,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/")@@ -1673,7 +1673,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@@ -1873,7 +1873,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@@ -2140,7 +2140,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 }@@ -2601,7 +2601,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@@ -2659,7 +2659,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"@@ -3217,7 +3217,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." }@@ -3249,9 +3249,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 }@@ -3782,7 +3782,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@@ -4048,9 +4048,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@@ -4329,7 +4329,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.@@ -4338,7 +4338,7 @@ _check_dmesg_for() # lockdep. _check_dmesg_filter() { - 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" }@@ -4356,7 +4356,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:" \common/repair +1
-1@@ -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 uscommon/xfs +6
-6@@ -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@@ -966,8 +966,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}" }@@ -1107,8 +1107,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 \tests/btrfs/011 +1
-1@@ -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_puttests/btrfs/100 +1
-1@@ -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'\`"tests/btrfs/101 +1
-1@@ -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'\`"tests/btrfs/187 +1
-1@@ -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 exittests/btrfs/252 +1
-1@@ -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"tests/ext4/006 +1
-1@@ -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 fitests/generic/164 +1
-1@@ -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() {tests/generic/165 +1
-1@@ -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() {tests/generic/454 +1
-1@@ -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}."tests/generic/670 +1
-1@@ -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() {tests/xfs/008 +1
-1@@ -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 fitests/xfs/012 +1
-1@@ -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 $outtests/xfs/033 +1
-1@@ -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 heretests/xfs/064 +2
-2@@ -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 2tests/xfs/065 +1
-1@@ -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 }tests/xfs/083 +1
-1@@ -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 fitests/xfs/122 +2
-2@@ -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);}' |\tests/xfs/138 +1
-1@@ -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=0tests/xfs/185 +1
-1@@ -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"tests/xfs/186 +2
-2@@ -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 }tests/xfs/293 +1
-1@@ -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" donetests/xfs/330 +1
-1@@ -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"tests/xfs/422 +1
-1@@ -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"tests/xfs/499 +1
-1@@ -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 };tests/xfs/505 +1
-1@@ -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" donetests/xfs/514 +1
-1@@ -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" donetests/xfs/515 +1
-1@@ -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" donetests/xfs/517 +1
-1@@ -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"tests/xfs/520 +1
-1@@ -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 ] || \tests/xfs/530 +1
-1@@ -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"tests/xfs/539 +1
-1@@ -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."Signature · 1 line
2.31.1
Aha, I missed that. Your patch looks fine and let's go with it.
Thanks~
Quoted 881 lines · Zorro Lang
Quoted 7 lines · Murphy Zhou
Since this grep commit:
commita9515624709865d480e3142fd959bccd1c9372d1
Author: Paul Eggert <[email protected]>
Date: Sun Aug 15 10:52:13 2021 -0700egrep, fgrep: now obsolete
Quoted 7 lines
egrep will trigger a warning like:
+egrep: warning: egrep is obsolescent; using grep -EThis will break many gold output.
Signed-off-by Murphy Zhou <[email protected]>---
I've sent a patch for this issue, and it's been reviewed:
https://lore.kernel.org/fstests/20220913125258.exj4iszolctiuxv2@zlang-mailbox/T/#tWelcome more review points, if you still find more problems after merging it.
Thanks,
ZorroQuoted 855 lines
check | 2 +- common/btrfs | 4 ++-- common/dmlogwrites | 2 +- common/dump | 4 ++-- common/encrypt | 4 ++-- common/filter | 2 +- common/fuzzy | 6 +++--- common/populate | 2 +- common/quota | 8 ++++---- common/rc | 36 ++++++++++++++++++------------------ common/repair | 2 +- common/xfs | 12 ++++++------ tests/btrfs/011 | 2 +- tests/btrfs/100 | 2 +- tests/btrfs/101 | 2 +- tests/btrfs/187 | 2 +- tests/btrfs/252 | 2 +- tests/ext4/006 | 2 +- tests/generic/164 | 2 +- tests/generic/165 | 2 +- tests/generic/454 | 2 +- tests/generic/670 | 2 +- tests/xfs/008 | 2 +- tests/xfs/012 | 2 +- tests/xfs/033 | 2 +- tests/xfs/064 | 4 ++-- tests/xfs/065 | 2 +- tests/xfs/083 | 2 +- tests/xfs/122 | 4 ++-- tests/xfs/138 | 2 +- tests/xfs/185 | 2 +- tests/xfs/186 | 4 ++-- tests/xfs/293 | 2 +- tests/xfs/330 | 2 +- tests/xfs/422 | 2 +- tests/xfs/499 | 2 +- tests/xfs/505 | 2 +- tests/xfs/514 | 2 +- tests/xfs/515 | 2 +- tests/xfs/517 | 2 +- tests/xfs/520 | 2 +- tests/xfs/530 | 2 +- tests/xfs/539 | 2 +- 43 files changed, 76 insertions(+), 76 deletions(-)check +1
-1@@ -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.arglistcommon/btrfs +2
-2@@ -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>')" }common/dmlogwrites +1
-1@@ -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 ]; thencommon/dump +2
-2@@ -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 1common/encrypt +2
-2@@ -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, evencommon/filter +1
-1@@ -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.30common/fuzzy +3
-3@@ -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. #common/populate +1
-1@@ -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}"common/quota +4
-4@@ -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 usingcommon/rc +18
-18@@ -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)) }@@ -1080,7 +1080,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@@ -1165,13 +1165,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/")@@ -1673,7 +1673,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@@ -1873,7 +1873,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@@ -2140,7 +2140,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 }@@ -2601,7 +2601,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@@ -2659,7 +2659,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"@@ -3217,7 +3217,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." }@@ -3249,9 +3249,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 }@@ -3782,7 +3782,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@@ -4048,9 +4048,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@@ -4329,7 +4329,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.@@ -4338,7 +4338,7 @@ _check_dmesg_for() # lockdep. _check_dmesg_filter() { - 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" }@@ -4356,7 +4356,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:" \common/repair +1
-1@@ -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 uscommon/xfs +6
-6@@ -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@@ -966,8 +966,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}" }@@ -1107,8 +1107,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 \tests/btrfs/011 +1
-1@@ -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_puttests/btrfs/100 +1
-1@@ -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'\`"tests/btrfs/101 +1
-1@@ -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'\`"tests/btrfs/187 +1
-1@@ -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 exittests/btrfs/252 +1
-1@@ -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"tests/ext4/006 +1
-1@@ -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 fitests/generic/164 +1
-1@@ -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() {tests/generic/165 +1
-1@@ -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() {tests/generic/454 +1
-1@@ -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}."tests/generic/670 +1
-1@@ -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() {tests/xfs/008 +1
-1@@ -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 fitests/xfs/012 +1
-1@@ -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 $outtests/xfs/033 +1
-1@@ -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 heretests/xfs/064 +2
-2@@ -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 2tests/xfs/065 +1
-1@@ -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 }tests/xfs/083 +1
-1@@ -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 fitests/xfs/122 +2
-2@@ -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);}' |\tests/xfs/138 +1
-1@@ -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=0tests/xfs/185 +1
-1@@ -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"tests/xfs/186 +2
-2@@ -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 }tests/xfs/293 +1
-1@@ -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" donetests/xfs/330 +1
-1@@ -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"tests/xfs/422 +1
-1@@ -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"tests/xfs/499 +1
-1@@ -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 };tests/xfs/505 +1
-1@@ -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" donetests/xfs/514 +1
-1@@ -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" donetests/xfs/515 +1
-1@@ -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" donetests/xfs/517 +1
-1@@ -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"tests/xfs/520 +1
-1@@ -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 ] || \tests/xfs/530 +1
-1@@ -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"tests/xfs/539 +1
-2@@ -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." --2.31.1
Quoted 1 line · Murphy Zhou
Aha, I missed that. Your patch looks fine and let's go with it.
Darrick and I agree with deal with this "egrep obsolescent" problem by your patch, I'll review this patch soon, please wait a minute :)
Thanks,
Zorro
Quoted 886 lines
Thanks~
Quoted 881 lines · Zorro Lang
Quoted 7 lines · Murphy Zhou
Since this grep commit:
commita9515624709865d480e3142fd959bccd1c9372d1
Author: Paul Eggert <[email protected]>
Date: Sun Aug 15 10:52:13 2021 -0700egrep, fgrep: now obsolete
Quoted 7 lines
egrep will trigger a warning like:
+egrep: warning: egrep is obsolescent; using grep -EThis will break many gold output.
Signed-off-by Murphy Zhou <[email protected]>---
I've sent a patch for this issue, and it's been reviewed:
https://lore.kernel.org/fstests/20220913125258.exj4iszolctiuxv2@zlang-mailbox/T/#tWelcome more review points, if you still find more problems after merging it.
Thanks,
ZorroQuoted 855 lines
check | 2 +- common/btrfs | 4 ++-- common/dmlogwrites | 2 +- common/dump | 4 ++-- common/encrypt | 4 ++-- common/filter | 2 +- common/fuzzy | 6 +++--- common/populate | 2 +- common/quota | 8 ++++---- common/rc | 36 ++++++++++++++++++------------------ common/repair | 2 +- common/xfs | 12 ++++++------ tests/btrfs/011 | 2 +- tests/btrfs/100 | 2 +- tests/btrfs/101 | 2 +- tests/btrfs/187 | 2 +- tests/btrfs/252 | 2 +- tests/ext4/006 | 2 +- tests/generic/164 | 2 +- tests/generic/165 | 2 +- tests/generic/454 | 2 +- tests/generic/670 | 2 +- tests/xfs/008 | 2 +- tests/xfs/012 | 2 +- tests/xfs/033 | 2 +- tests/xfs/064 | 4 ++-- tests/xfs/065 | 2 +- tests/xfs/083 | 2 +- tests/xfs/122 | 4 ++-- tests/xfs/138 | 2 +- tests/xfs/185 | 2 +- tests/xfs/186 | 4 ++-- tests/xfs/293 | 2 +- tests/xfs/330 | 2 +- tests/xfs/422 | 2 +- tests/xfs/499 | 2 +- tests/xfs/505 | 2 +- tests/xfs/514 | 2 +- tests/xfs/515 | 2 +- tests/xfs/517 | 2 +- tests/xfs/520 | 2 +- tests/xfs/530 | 2 +- tests/xfs/539 | 2 +- 43 files changed, 76 insertions(+), 76 deletions(-)check +1
-1@@ -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.arglistcommon/btrfs +2
-2@@ -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>')" }common/dmlogwrites +1
-1@@ -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 ]; thencommon/dump +2
-2@@ -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 1common/encrypt +2
-2@@ -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, evencommon/filter +1
-1@@ -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.30common/fuzzy +3
-3@@ -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. #common/populate +1
-1@@ -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}"common/quota +4
-4@@ -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 usingcommon/rc +18
-18@@ -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)) }@@ -1080,7 +1080,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@@ -1165,13 +1165,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/")@@ -1673,7 +1673,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@@ -1873,7 +1873,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@@ -2140,7 +2140,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 }@@ -2601,7 +2601,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@@ -2659,7 +2659,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"@@ -3217,7 +3217,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." }@@ -3249,9 +3249,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 }@@ -3782,7 +3782,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@@ -4048,9 +4048,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@@ -4329,7 +4329,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.@@ -4338,7 +4338,7 @@ _check_dmesg_for() # lockdep. _check_dmesg_filter() { - 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" }@@ -4356,7 +4356,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:" \common/repair +1
-1@@ -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 uscommon/xfs +6
-6@@ -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@@ -966,8 +966,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}" }@@ -1107,8 +1107,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 \tests/btrfs/011 +1
-1@@ -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_puttests/btrfs/100 +1
-1@@ -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'\`"tests/btrfs/101 +1
-1@@ -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'\`"tests/btrfs/187 +1
-1@@ -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 exittests/btrfs/252 +1
-1@@ -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"tests/ext4/006 +1
-1@@ -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 fitests/generic/164 +1
-1@@ -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() {tests/generic/165 +1
-1@@ -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() {tests/generic/454 +1
-1@@ -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}."tests/generic/670 +1
-1@@ -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() {tests/xfs/008 +1
-1@@ -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 fitests/xfs/012 +1
-1@@ -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 $outtests/xfs/033 +1
-1@@ -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 heretests/xfs/064 +2
-2@@ -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 2tests/xfs/065 +1
-1@@ -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 }tests/xfs/083 +1
-1@@ -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 fitests/xfs/122 +2
-2@@ -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);}' |\tests/xfs/138 +1
-1@@ -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=0tests/xfs/185 +1
-1@@ -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"tests/xfs/186 +2
-2@@ -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 }tests/xfs/293 +1
-1@@ -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" donetests/xfs/330 +1
-1@@ -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"tests/xfs/422 +1
-1@@ -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"tests/xfs/499 +1
-1@@ -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 };tests/xfs/505 +1
-1@@ -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" donetests/xfs/514 +1
-1@@ -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" donetests/xfs/515 +1
-1@@ -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" donetests/xfs/517 +1
-1@@ -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"tests/xfs/520 +1
-1@@ -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 ] || \tests/xfs/530 +1
-1@@ -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"tests/xfs/539 +1
-2@@ -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." --2.31.1
Quoted 7 lines · Murphy Zhou
Since this grep commit:
commit a9515624709865d480e3142fd959bccd1c9372d1 Author: Paul Eggert <[email protected]> Date: Sun Aug 15 10:52:13 2021 -0700 egrep, fgrep: now obsolete
Quoted 7 lines
egrep will trigger a warning like:
+egrep: warning: egrep is obsolescent; using grep -EThis will break many gold output.
Signed-off-by Murphy Zhou <[email protected]>---
Hi,
Please rebase this patch on latest fstests for-next branch, I hit below CONFLICT when I try to merge it:
$ git am -3 ./20220914_jencce_kernel_egrep_fgrep_deprecated.mbx Applying: egrep, fgrep: deprecated Using index info to reconstruct a base tree... M check M common/encrypt M common/rc M common/xfs Falling back to patching base and 3-way merge... Auto-merging common/xfs Auto-merging common/rc CONFLICT (content): Merge conflict in common/rc Auto-merging common/encrypt Auto-merging check error: Failed to merge in the changes. Patch failed at 0001 egrep, fgrep: deprecated hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
One more tiny question below ...
Quoted 4 lines
check | 2 +- common/btrfs | 4 ++-- common/dmlogwrites | 2 +- common/dump | 4 ++--
[snip]
tests/xfs/064 while [ $i -le 9 ]; do · line 51
Quoted 7 lines
# real QA test starts heretests/xfs/064 +1
-1@@ -48,7 +48,7 @@ while [ $i -le 9 ]; do if [ $i -gt 0 ]; then sleep 2 _modify_level $i - fi + fi
What's this change for?
Thanks,
Zorro
Quoted 231 lines
tests/xfs/064 +0
-0_stable_fs sleep 2tests/xfs/065 +1
-1@@ -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 }tests/xfs/083 +1
-1@@ -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 fitests/xfs/122 +2
-2@@ -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);}' |\tests/xfs/138 +1
-1@@ -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=0tests/xfs/185 +1
-1@@ -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"tests/xfs/186 +2
-2@@ -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 }tests/xfs/293 +1
-1@@ -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" donetests/xfs/330 +1
-1@@ -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"tests/xfs/422 +1
-1@@ -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"tests/xfs/499 +1
-1@@ -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 };tests/xfs/505 +1
-1@@ -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" donetests/xfs/514 +1
-1@@ -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" donetests/xfs/515 +1
-1@@ -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" donetests/xfs/517 +1
-1@@ -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"tests/xfs/520 +1
-1@@ -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 ] || \tests/xfs/530 +1
-1@@ -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"tests/xfs/539 +1
-1@@ -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."Signature · 1 line
2.31.1
Hi
Quoted 33 lines · Zorro Lang
Quoted 7 lines · Murphy Zhou
Since this grep commit:
commita9515624709865d480e3142fd959bccd1c9372d1
Author: Paul Eggert <[email protected]>
Date: Sun Aug 15 10:52:13 2021 -0700egrep, fgrep: now obsolete
Quoted 7 lines
egrep will trigger a warning like:
+egrep: warning: egrep is obsolescent; using grep -EThis will break many gold output.
Signed-off-by Murphy Zhou <[email protected]>---
Hi,
Please rebase this patch on latest fstests for-next branch, I hit below CONFLICT when I try to merge it:
$ git am -3 ./20220914_jencce_kernel_egrep_fgrep_deprecated.mbx Applying: egrep, fgrep: deprecated Using index info to reconstruct a base tree... M check M common/encrypt M common/rc M common/xfs Falling back to patching base and 3-way merge... Auto-merging common/xfs Auto-merging common/rc CONFLICT (content): Merge conflict in common/rc
Quoted 8 lines
Auto-merging common/encrypt Auto-merging check error: Failed to merge in the changes. Patch failed at 0001 egrep, fgrep: deprecated hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
Rebased. Will send v2.
Quoted 10 lines
One more tiny question below ...
Quoted 4 lines
check | 2 +- common/btrfs | 4 ++-- common/dmlogwrites | 2 +- common/dump | 4 ++--[snip]
Quoted 9 lines
tests/xfs/064 while [ $i -le 9 ]; do · line 51
Quoted 7 lines
# real QA test starts heretests/xfs/064 +1
-1@@ -48,7 +48,7 @@ while [ $i -le 9 ]; do if [ $i -gt 0 ]; then sleep 2 _modify_level $i - fi + fiWhat's this change for?
Cleaned a trailing whitespace up by the way.
Thanks for the review!
Regards~
Quoted 236 lines
Thanks,
ZorroQuoted 231 lines
tests/xfs/064 +0
-0_stable_fs sleep 2tests/xfs/065 +1
-1@@ -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 }tests/xfs/083 +1
-1@@ -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 fitests/xfs/122 +2
-2@@ -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);}' |\tests/xfs/138 +1
-1@@ -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=0tests/xfs/185 +1
-1@@ -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"tests/xfs/186 +2
-2@@ -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 }tests/xfs/293 +1
-1@@ -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" donetests/xfs/330 +1
-1@@ -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"tests/xfs/422 +1
-1@@ -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"tests/xfs/499 +1
-1@@ -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 };tests/xfs/505 +1
-1@@ -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" donetests/xfs/514 +1
-1@@ -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" donetests/xfs/515 +1
-1@@ -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" donetests/xfs/517 +1
-1@@ -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"tests/xfs/520 +1
-1@@ -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 ] || \tests/xfs/530 +1
-1@@ -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"tests/xfs/539 +1
-2@@ -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." --2.31.1