On 17/11/16 02:51, Bernhard Voelker wrote: > On 11/12/2016 12:24 AM, 積丹尼 Dan Jacobson wrote: >> Please add [...] > >> --print-summary >> Print totals at end. >> >> --quiet >> Suppress file content output. > > Just for fun (...), I've put the requested functionality into the > attached patch. > > I'm only 60:40 for adding this to coreutils, as this may be considered > as feature creep bloating the code; OTOH the size of the additional > code it not so scaring, so I'll leave the decision up to the other CU > maintainers. > > BTW: --quiet is not needed, because you can use "-123". ;-)
Usually you'd want counts separately from each other and separate from the data itself, in which case wc -l suffices: $ echo Lines in both = $(comm -12 file1 file2 | wc -l) $ echo Lines only in 1st = $(comm -23 file1 file2 | wc -l) $ echo Lines only in 2nd = $(comm -13 file1 file2 | wc -l) So this is in the efficiency/convenience category. I'm 50:50 on it (which means it goes in without further feedback). thanks for the patch! Pádraig.
