Created
May 2, 2021 01:12
-
-
Save gh640/8e31e63afa569ef9cb756b46d3d59d62 to your computer and use it in GitHub Desktop.
Samples: `seq` command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Normal | |
seq 1 5 | |
# 1 | |
# 2 | |
# 3 | |
# 4 | |
# 5 | |
seq 5 1 | |
# 5 | |
# 4 | |
# 3 | |
# 2 | |
# 1 | |
# With Step | |
seq 1 .5 3 | |
# 1 | |
# 1.5 | |
# 2 | |
# 2.5 | |
# 3 | |
seq 1 .5 2.9 | |
# 1 | |
# 1.5 | |
# 2 | |
# 2.5 | |
# With `-w`: equal widths with zero padding | |
seq -w 8 15 | |
# 08 | |
# 09 | |
# 10 | |
# 11 | |
# 12 | |
# 13 | |
# 14 | |
# 15 | |
# With `-f`: printf-like formatting | |
seq -f '%02g' 8 15 | |
# 08 | |
# 09 | |
# 10 | |
# 11 | |
# 12 | |
# 13 | |
# 14 | |
# 15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ref: