1. Command Introduction The seq (Sequence) command is used to generate all integers from the starting number to the ending number according to the specified step size. The default value 1 can be used for the start number and step size, but the end number must be specified. 2. Command format seq [OPTION]... LAST seq [OPTION]... FIRST LAST seq [OPTION]... FIRST INCREMENT LAST 3. Option Description Note that mandatory arguments for long options are mandatory for short options as well. -f, --format=FORMAT Use printf-style floating point format -s, --separator=STRING Separate numbers using the specified string (default: \n) -w, --equal-width Add 0 to numbers to make them the same width --help Display this help message and exit --version Display version information and exit 4. Common Examples (1) Output 1 to 5. seq 5 # or seq 1 5 # or seq 1 1 5 (2) Generate a sequence of integers from 10 to 50 with a step size of 10. seq 10 10 50 10 20 30 40 50 (3) Output in the specified format num%03g. num is the prefix string, %03g means the number width is 3, if it is less than 3, 0 will be added in front. seq -f"num%03g" 3 num001 num002 num003 (4) Add leading zeros to make the numbers have the same width. seq -w 9 11 09 10 11 Note that you cannot specify a format string when outputting a fixed-width string, that is, -w and -f cannot be used together. (5) Use the specified string to separate numbers. seq -w -s "," 9 11 09,10,11 (6) Use Tab to separate numbers. seq -s "`echo -e '\t'`" 9 11 9 10 11 First use the command to create a Tab, and then specify it as a separator. References The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Detailed explanation of MySQL database binlog cleanup command
>>: In-depth understanding of React Native custom routing management
Table of contents FileReader reads local files or...
Table of contents 1. What is DOM 2. Select elemen...
This article shares the encapsulation code of Jav...
Error message: Job for mysqld.service failed beca...
KVM stands for Kernel-based Virtual Machine, whic...
This article describes the support and problem so...
1. Transaction characteristics (ACID) (1) Atomici...
A WeakMap object is a collection of key/value pai...
1. The color of the scroll bar under xhtml In the ...
It is very simple to build a kong cluster under t...
I just started learning database operations. Toda...
Table of contents 1. LVS load balancing 2. Basic ...
This article shares the specific code of JS to ac...
Purpose: Nested use of MySQL aggregate functions ...
Table of contents Preface How to implement Vuex f...