Used to generate all integers from one number to another
Example one:
# seq 1 10
The result is 1 2 3 4 5 6 7 8 9 10
Example two:
#!/bin/bash
For i in ' seq 1 10 ';
Do
echo $i;
Done
or with
For I in $ (SEQ 1 10)
can also
seq
-F,--format=format use printf style floating-point format (default:%G)
-S,--separator=string use STRING to separate numbers (default:/N)
-W,--equal-width equalize width by padding with leading zeroes
- FOptions Specify format
#seq-F "%3g" 9 11
9
10
11
% the number of digits specified after the default is "%g",
"%3G" then the number of digits is not enough space
#sed-F "%03g" 9 11 so the number of digits is less than 0.
% before the string is drawn
Seq-f "STR%03G" 9 11
str009
str010
str011
- WSpecifies that the output number is equal to the width cannot be used with-f
Seq-w-F "str%03g" 9 11
Seq:format string May is specified when printing equal width strings
SEQ-W 98 101
098
099
100
101
The output is the same width
- SSpecifies that the delimiter is carriage return by default
Seq-s ""-F "str%03g" 9 11
str009 str010 str011
To specify/t as the separator symbol
Seq-s "' Echo-e"/t "'" 9 11
Specify/n/n as the separator symbol
Seq-s "' Echo-e"/n/n "'" 9 11
19293949596979899910911
Got a bad result.
But it doesn't have to be that way. The default is enter as the delimiter
Usage of the SEQ command in Linux