-
Notifications
You must be signed in to change notification settings - Fork 0
/
xlseq.1
65 lines (65 loc) · 1.15 KB
/
xlseq.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.TH XLSEQ 1 xlseq-1.0.0
.SH NAME
xlseq - continue a sequence, Excel style
.SH SYNOPSIS
.SY
.OP \-cn count
sequence
.YS
.SH DESCRIPTION
.P
.B xlseq
takes a sequence as command line parameters separated by whitespace
and attempts to detect a correlation and continue the sequence.
Sequences can be continued as far as is possible (bounded sequence) or
as many as specified (unbounded sequence).
.P
Output is printed whitespace delimited on a single line, which means
it is suitable for use in shell loops and is easy to parse using
.BR awk (1)
or
.BR cut (1).
.SH OPTIONS
.TP
.B \-c
Continue sequence for
.I count
iterations
.TP
.B \-n
Get
.I count
results in total. Count must be greater than the length of the initial
set given, else an error is returned.
.TP
.B \-u
Show help
.TP
.B \-h
Show help
.SH EXAMPLES
.SS COUNT TO TEN
.EX
$ xlseq -n10 1 2 3
.EE
.SS SHOW SQUARE NUMBERS
.EX
$ xlseq -c5 1 4 9 16
.EE
.SS DETECT COMPLEX SEQUENCES
This is the sequence for 3x^2 + 2x + 5
.EX
$ xlseq -c10 10 33 92 205 390
.EE
.SS SHELL LOOP
.EX
$ echo "The days of the week are"
$ for day in $(xlseq monday tuesday)
do
echo "$day"
done
.EE
.SH SEE ALSO
.BR seq (1)
.BR shuf (1)
.BR bc (1)