Summary of usage of SEQ in shell

Source: Internet
Author: User

usage: seq [options] ... Mantissa
or: seq [options] ... First number mantissa
or: seq [options] ... The first number increment mantissa
Prints the number to the mantissa starting with the specified increment from the first number.
   -f,--format= format uses the printf-style floating-point format
   -s,--separator= string separates numbers by using the specified string (default: \ n)
   -w,--equal-width add 0 before column to make the same width
         --help Display this help message and exit
         --version display version information and exit
If first or increment is omitted, the default value is 1. Even then the mantissa is still less than the first number. The
first, increment, and mantissa are interpreted as floating-point numbers. When the first number is less than the mantissa, the increment is generally positive, and the
opposite is generally negative when the first number is greater than the mantissa. The format specified by the
must apply to parameters that display the type "double", which defaults to "%. Precision F" When the first number, increment, and mantissa are the fixed-point decimal numbers of the specified
precision. Otherwise the default is "%g".
two ways to loop from 1 to 100 (bash other shells have not tried)
for x in ' seq 1 ';d o echo $x;d one
for x in {1..100};d o echo $x;d one
output 1-10 0, number not containing the number 7, and cannot be divisible by 7
Seq | grep-v "7" | awk ' $0%7!=0{print} '

In addition, you can do this without SEQ:
[[Email protected]]# for i in {1..10};d o echo $i;d one
Between 1 and 10 is a two-half-corner point.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Summary of usage of SEQ in shell

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.