bug-sh-utils
[Top][All Lists]
Advanced

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

seq documentation border cases


From: Huaiyu Zhu
Subject: seq documentation border cases
Date: Fri, 8 Mar 2002 10:48:02 -0800 (PST)

Topic:
-----

The INCREMENT in seq when FIRST equals LAST.


Platform and version:
---------------------

SuSE 7.1
$ rpm -qf /usr/bin/seq
sh-utils-2.0-6


Problem:
--------

The documentation says that the increment should be negative.  The
implementation requires it to be positive, while the error message says
nothing in this case.  Theoretically any number should be allowed.  Note
that mathematically "smaller" does not include "equal".


Example:
--------

$ seq 3 -2 3
seq: when the starting value is smaller than the limit,
the increment must be positive
Try `seq --help' for more information.
$ seq --help
Usage: seq [OPTION]... LAST
  or:  seq [OPTION]... FIRST LAST
  or:  seq [OPTION]... FIRST INCREMENT LAST
Print numbers from FIRST to LAST, in steps of INCREMENT.
[...]
INCREMENT should be positive if FIRST is smaller than LAST, and negative
otherwise.  [...]


Suggested solution:
------------------

Change the documentation to (and change implementation to comply to):

INCREMENT should be positive if FIRST is smaller than LAST.  It should be
negative if FIRST is larger than LAST.  Otherwise it can be any number.


Regards,

Huaiyu





reply via email to

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