Re: [PATCH] t0021: expect more variations in the output of uniq -c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 06.11.2016 um 16:31 schrieb Lars Schneider:
This looks good to me. I wonder if I should post a patch
to add the "|| return" trick to the following function
"test_cmp_exclude_clean", too?!

The function does this:

        for FILE in "$expect" "$actual"
        do
                grep -v "IN: clean" "$FILE" >"$FILE.tmp" &&
                mv "$FILE.tmp" "$FILE"
        done &&

It is an interesting case: If only matching lines are in the file, nothing would be printed, and grep returns failure. But we shouldn't care, because, strictly speaking, the function only wants to remove lines with a certain pattern. Here, it actually hurts to &&-chain grep!

It wouldn't hurt to write 'mv ... || return', but at the same time, && after grep should be removed.

-- Hannes




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]