bug-coreutils
[Top][All Lists]
Advanced

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

bug#23110: seq apparent bug


From: Paul Eggert
Subject: bug#23110: seq apparent bug
Date: Fri, 8 Apr 2016 15:21:17 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1

On 04/08/2016 01:51 PM, Ruediger Meier wrote:
On Friday 08 April 2016, Paul Eggert wrote:
For this I suggest the following heuristic. When inferring a format that would apply to two or more lines of output, try formatting the first two lines and report an error if they are the same.
Hm, I think printing identical lines is a valid use case:
$ seq -f "%0.1f" 0 0.02 0.1
0.0
0.0
0.0
0.1
0.1
0.1

Sure, but the heuristic I suggested was for inferred formats only. It was not intended for formats explicitly specified via -f.

I would check it before the loop like this

if ((first + inc) == first)
        /* exit error */

I think I'd prefer testing what the user would see, instead of testing some internal variable.

maybe the user _wants_ an effective endless (non
trivial) sequence

If we make an increment of zero an error, then there's no way for the 'seq' user to say they want an endless identical sequence. But there's always the 'yes' program for that.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]