Used to generate all integers between one number and the other.
Example 1:
# Seq 1 10
The result is 1 2 3 4 5 6 7 8 9 10.
Example 2:
#! /Bin/bash
For I in 'seq 1 10 ';
Do
Echo $ I;
Done
Or use
For I in $ (SEQ 1 10)
Yes.
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
-FOption format
# Seq-F "% 3G" 9 11
9
10
11
% The default number of digits after the specified number is "% G ",
"% 3G", less than a digit is a space
# Sed-F "% 03G" 9 11. If this is the case, less than 0 digits are allowed.
% String
SEQ-F "str % 03G" 9 11
Str009
Str010
Str011
-WThe specified output number and width cannot be used together with-f.
SEQ-w-F "str % 03G" 9 11
SEQ: Format String may not be specified when printing equal width strings
SEQ-W 98, 101
098
099
100
101
The output is of the same width.
-SThe default Delimiter is carriage return.
SEQ-s ""-F "str % 03G" 9 11
Str009 str010 str011
Specify/T as the Separator
SEQ-s "'echo-e"/t "'" 9 11
Specify/n as the Separator
SEQ-s "'echo-e"/n "'" 9 11
19293949596979899910911
An error is returned.
However, this is not necessary. The default carriage return is used as the separator.