seq

seq

Usage: $0 START END OPERATION

with START and END decimal numbers, possibly prefixed with + or -, and OPERATION of the form @NUMBER, where @ is one of the operators [-+*/].

Description This prints the numbers

START

START @NUMBER

START @NUMBER @NUMBER

etc. that are strictly less (for operation @ being + and *) respectively strictly greater (for - and /) than END.

If @ is omitted it defaults to ‘+’.

If OPERATION is omitted it defaults to +1

If START is also omitted it defaults to 0.

Examples:

5 → 0 1 2 3 4

1 5 2 → 1 3

3 -3 -1 → 3 2 1 0 -1 -2

32 0 /2 → 32 16 8 4 2 1

Restrictions

This tool is relatively picky. It should not accept anything else than numbers and the resulting range must not be empty.

Coding and configuration

The following code is needed to enable the sh-module framework.

SRC="$_" . "${0%%/${0##*/}}/import.sh"

Imports

The following sh-modules are imported:

Details