1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-18 01:40:06 +02:00

doc: clarify when seq ends

* doc/coreutils.texi (seq invocation): Add a sentence clarifying
that seq terminates when LAST becomes smaller than the current number
plus INCREMENT.
* src/seq.c (usage): Likewise.
Fixes http://bugs.gnu.org/15068
This commit is contained in:
Bernhard Voelker
2013-08-10 17:19:06 +02:00
parent 448030a2bf
commit 4e9f5eb4e2
2 changed files with 5 additions and 0 deletions

View File

@@ -16810,6 +16810,9 @@ When @var{increment} is not specified, it defaults to @samp{1},
even when @var{first} is larger than @var{last}.
@var{first} also defaults to @samp{1}. So @code{seq 1} prints
@samp{1}, but @code{seq 0} and @code{seq 10 5} produce no output.
The sequence of numbers ends when the sum of the current number and
@var{increment} would become greater than @var{last},
so @code{seq 1 10 10} only produces @samp{1}.
Floating-point numbers may be specified. @xref{Floating point}.
The program accepts the following options. Also see @ref{Common options}.

View File

@@ -87,6 +87,8 @@ Print numbers from FIRST to LAST, in steps of INCREMENT.\n\
\n\
If FIRST or INCREMENT is omitted, it defaults to 1. That is, an\n\
omitted INCREMENT defaults to 1 even when LAST is smaller than FIRST.\n\
The sequence of numbers ends when the sum of the current number and\n\
INCREMENT would become greater than LAST.\n\
FIRST, INCREMENT, and LAST are interpreted as floating point values.\n\
INCREMENT is usually positive if FIRST is smaller than LAST, and\n\
INCREMENT is usually negative if FIRST is greater than LAST.\n\