SEQ(1) User Commands SEQ(1)

seq - print a sequence of numbers

seq [-s separator] [start [step]] stop

The seq utility prints a sequence of numbers, one per line or separated per a character defined by the user, from the start (which is defaulted to 1) as near as possible to stop, in steps of step.
It works in a similar spirit than a for() loop, present in the C, Go and ksh93(1) programming languages, and also range() in Python.

It accepts the following options:

Defines a character to be the separator between the numbers being printed. The default is a line break ("\n").

The seq utility may be used as one of the ways to calculate a termial (n) in a quick way using in a pipeline.

example% seq -s'+' 4 | bc

No, it does not support floating points, altough it's fairly faster than the most common GNU implementation when counting small (less than 10^4) numbers. This was tested on a AMD Ryzen 5 3500U.

If you need to count from a negative number to a positive one, you will need to do this maneuver below, at least for now:

example% seq -s' ' -- -5 10

It does not implement the -w option neither -f found in Plan 9 from Bell Labs' implementation.

Maybe?

A seq command first appeared in AT&T Research Unix 8th edition.
This version has its payloads based off Plan 9 from Bell Labs, 1th Ed. and GNU shell utilities 1.13 implementation, but only part of the standard was implemented.

06/03/23 Heirloom Toolchest