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