mirror of
https://github.com/GnoConsortium/gno.git
synced 2025-01-23 09:33:43 +00:00
16 lines
428 B
Awk
16 lines
428 B
Awk
|
# seq - print sequences of integers
|
||
|
# input: arguments q, p q, or p q r; q >= p; r > 0
|
||
|
# output: integers 1 to q, p to q, or p to q in steps of r
|
||
|
|
||
|
BEGIN {
|
||
|
if (ARGC == 2)
|
||
|
for (i = 1; i <= ARGV[1]; i++)
|
||
|
print i
|
||
|
else if (ARGC == 3)
|
||
|
for (i = ARGV[1]; i <= ARGV[2]; i++)
|
||
|
print i
|
||
|
else if (ARGC == 4)
|
||
|
for (i = ARGV[1]; i <= ARGV[2]; i += ARGV[3])
|
||
|
print i
|
||
|
}
|