Seq Command Summary
Example One:
# seq 1 10
The result is 1 4 5 6 7 8 9
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-pointformat (default:%g)
-S,--separator=string use stringto separate numbers (default: \ n)
-W,--equal-width equalize width by padding with leading zeroes
- F options Specify Format
#seq-F "%3g" 911
9
10
11
% The number of digits following the specified number is "%g" by default .
"%3g" then the number of digits is less than the space
#sed-F "%03g" 9 In this case, the low number of digits is 0.
% make string earlier
Seq-f "STR%03G" 9 11
str009
str010
str011
- W specifies 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 whenprinting equal width strings
SEQ-W 98 101
098
099
100
101
the output is the same width
- s specifies 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 "'" 911
specify \ n as the separator symbol
Seq-s "' Echo-e" \ n "'" 911
19293949596979899910911
Seq Command Summary