Linux command--seq

Source: Internet
Author: User

The SEQ command is used to generate all integers from one number to another.

Grammar

seq [Options] ... Mantissa seq [Options] ... First number of mantissa seq [options] ... First number increment Mantissa

Options

-f    Specify format, format output with printf style -S Use the    specified string to separate numbers (by default: \ n)-W    completion, add 0 to the column before the columns are the same width

Instance

-F Specify format

[[Email protected] ~] #  010203

% previous specified string

[[Email protected] ~] # seq-f "num%02g" 4 6 num04num05num06

-W Output Digital same width

[[Email protected] ~] # seq-w01020304050607080910
[[Email protected] ~] # seq-w 0000050100

-S Specify delimiter (default is carriage return)

[[Email protected] ~] # seq-s "-" Ten1-2-3-4-5-6-7-8-9-10

Paired with

[[Email protected] ~] # seq-s "--"-F "stu%03g" 5stu001-->stu002-->stu003-->stu004-->stu005

Script instance

1, the new 15 users, the user name format is stdxx, where xx from 01-15

# !/bin/bash  for  in ' seq-f'stu%02g '        useradd $idone

Linux command--seq

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.