1 Overview
- Generate command sequences
- Before seemingly written seq command, this time pulling out alone write it once
- Day parade put off
2. Command
1. Help
command
# 输出我就不打了, # 这个命令可用, 证明组件可用 > seq --help
2. Simple Sequence
command
# 输出 [1, 3] # 步长为 1 # seq 3 也可以 > seq 1 3 1 2 3
3. The sequence step
command
# 输出 [1, 5] # 步长为 2 > seq 1 2 5 1 3 5
4. The reverse sequence
command
# 输出 [1, 3] # 步长为 -1, 导致逆序 > seq 3 -1 1 3 2 1
The fractional step
command
> seq 1 0.5 3 1.0 1.5 2.0 2.5 3.0
6. custom delimiter
command
> seq -s, 1 3 1,2,3
7. The output width
command
> seq -w 1 10 01 02 03 04 05 06 07 08 09 10
8. Output Formatting
command
> seq -f 'format %g' 1 3 format 1 format 2 format 3
- other
- format
- format
- Single quotation marks
- % G needs to contain similar format placeholder
- Placeholder
- Placeholder
- After running, using numbers generated substitute
- kind
- a
- I'm sorry I can not read
- e
- Scientific notation
- f
- Float
- g
- The default format, I do not know what, but generally you can use this
- a
- Other modifications (where they talk about% g)
- The integer part of the output width: X
- For example:% 2g said output width is 2, is not filled with spaces
- If not, the value will still show up
- Partially filled integer 0
- For example:% 02g represents the output width is 2, 0 is filled with enough
- Consignee integer, decimal, if you want to fill 0, need f%
- Bit output display .X
- For example:% 2.4g said display two integer, two decimals
- Feeling a little pit
- If the number of decimal places displayed incomplete, you may use the format to display e%
- Align Right
- The default is right-aligned
- For example:% 3g represents an integer of length three, right, supplemented by a space shortage
- Left -
- For example:% -3g said Left
- feel
- It was a very troublesome thing,
- Also did not say too detailed,
- And other deep understanding, and again supplement
- The integer part of the output width: X
- By the way, I found two pit
- % G placeholders can appear only once, an error will occur twice
- Will complain
- An error
- Will complain
- Under the command line mode of vim ex,% # and need to escape, otherwise it will not
E.g
:r !seq -f '\#\# \%g' 1 3
- % G placeholders can appear only once, an error will occur twice
- Placeholder
- format
- format
3. Other
- First it right today
- Not think of anything to expand the
- Formatted output this thing, in fact, very good
- c, java, py have something like that
- I just did not learn
- Today, to understand more, later had to supplement
- This thing, I really do not know how to speak
- To understand, in fact, itself an arduous task
- Feeling better a few common examples
- But I'm not much use
- ref