From: Johannes Sixt Date: Sun, 06 Nov 2016 21:40:02 GMT Subject: Re: [PATCH] t0021: expect more variations in the output of uniq -c Message-ID: In-Reply-To: <0B7DE8F1-34DF-4271-8936-B9B596EF5F9E@gmail.com> 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