On 27/12/2022 19:31, наб wrote:
Package: coreutils
Version: 8.32-4+b1
Severity: normal

Dear Maintainer,

-- >8 --
$ truncate -s 2E a
$ wc -c a a a a a a a | uniq -c
        7  2305843009213693952 a
        1 16140901064495857664 total
$ wc -c a a a a a a a a | uniq -c
        8 2305843009213693952 a
        1                   0 total
$ wc -c a a a a a a a a a | uniq -c
        9 2305843009213693952 a
        1 2305843009213693952 total
$ wc -c a a a a a a a a a a | uniq -c
       10 2305843009213693952 a
        1 4611686018427387904 total
-- >8 --

Which is obviously wrong. One of the sensible solutions would be to just
saturate the totals, which would yield:
-- >8 --
$ wc -c a a a a a a a | uniq -c
       7  2305843009213693952 a
       1 16140901064495857664 total
$ wc -c a a a a a a a a | uniq -c
       8 2305843009213693952 a
       1 18446744073709551615 total
$ wc -c a a a a a a a a a | uniq -c
       9 2305843009213693952 a
       1 18446744073709551615 total
$ wc -c a a a a a a a a a a | uniq -c
      10 2305843009213693952 a
       1 18446744073709551615 total
-- >8 --

Which is just about the best solution here,
since this is hardly a common occurrence.

It's a good point.
We might just output ERR or NAN or something
in place of a total value in the overflow case.
We should also do the same in df --total

cheers,
Pádraig

Reply via email to