SEQ(1) User Commands SEQ(1)

seq - print a sequence of numbers

seq [-w] [-ppicture] [-sseparator] [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:

Sets the number of decimal places as a constant width per padding short numbers with leading decimal zeroes. It gets annulled if combined with -p.
Defines the number of decimal places to be printed after the decimal separator per using another number as a picture. The default is full precision (see "%g" at printf(3)).
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 bc(1) in a sh(1) pipeline.

example% seq -s'+' 4 | bc

It does not implement the -f option found in Plan 9 from Bell Labs' implementation, although -p can replace -f in many cases.

Maybe?

printf(3)

A seq command first appeared in AT&T Research Unix 8th edition.
This version has its payloads based off Research Unix 8th edition with some extensions that appeared in Plan 9 from Bell Labs, 1st Ed. and GNU shell utilities 1.13 — for the -s option.

02/25/24 Heirloom Toolchest