Curly braces extension-{}-enumeration and iteration

Source: Internet
Author: User
With curly braces extension, you can create multiple text strings according to the pattern in curly brackets.

Introduction

With curly braces extension, you can create multiple text strings according to the pattern in curly brackets.

============================================

, Mode [enumeration]

[Root @ allyes20121031 de_info_center] # echo front00001, 2, 3 minutes .txt

Front1.txt Front2.txt Front3.txt

[Root @ allyes20121031 de_info_center] #

============================================

... Mode [iteration]

[Root @ allyes20121031 de_info_center] # echo front0000a..z0000.txt

Fronta.txt Frontb.txt Frontc.txt Frontd.txt Fronte.txt Frontf.txt Frontg.txt Fronth.txt Fronti.txt Frontk.txt Frontl.txt Frontm.txt Fronto.txt Frontp.txt Frontr.txt Fronts.txt Frontt.txt Frontu.txt Frontv.txt Frontw.txt Frontx.txt frontxty.txt

[Root @ allyes20121031 de_info_center] #

============================================

Use cases

The most common application is to create a series of files and directories.

For example

[Root @ allyes20121031 shell_study] # mkdir {2009 .. 2011}-{1 .. 12}

[Root @ allyes20121031 shell_study] # ll

Total 144

Drwxr-xr-x 2 root 4096 May 27 2009-1

Drwxr-xr-x 2 root 4096 May 27 2009-10

Drwxr-xr-x 2 root 4096 May 27 2009-11

Drwxr-xr-x 2 root 4096 May 27 2009-12

Drwxr-xr-x 2 root 4096 May 27 2009-2

Drwxr-xr-x 2 root 4096 May 27 2009-3

Drwxr-xr-x 2 root 4096 May 27 2009-4

Drwxr-xr-x 2 root 4096 May 27 2009-5

Drwxr-xr-x 2 root 4096 May 27 2009-6

Drwxr-xr-x 2 root 4096 May 27 2009-7

Drwxr-xr-x 2 root 4096 May 27 2009-8

Drwxr-xr-x 2 root 4096 May 27 2009-9

Drwxr-xr-x 2 root 4096 May 27 2010-1

Drwxr-xr-x 2 root 4096 May 27 2010-10

Drwxr-xr-x 2 root 4096 May 27 2010-11

Drwxr-xr-x 2 root 4096 May 27 2010-12

Drwxr-xr-x 2 root 4096 May 27 2010-2

Drwxr-xr-x 2 root 4096 May 27 2010-3

Drwxr-xr-x 2 root 4096 May 27 2010-4

Drwxr-xr-x 2 root 4096 May 27 2010-5

Drwxr-xr-x 2 root 4096 May 27 2010-6

Drwxr-xr-x 2 root 4096 May 27 2010-7

Drwxr-xr-x 2 root 4096 May 27 2010-8

Drwxr-xr-x 2 root 4096 May 27 2010-9

Drwxr-xr-x 2 root 4096 May 27 2011-1

Drwxr-xr-x 2 root 4096 May 27 2011-10

Drwxr-xr-x 2 root 4096 May 27 2011-11

Drwxr-xr-x 2 root 4096 May 27 2011-12

Drwxr-xr-x 2 root 4096 May 27 2011-2

Drwxr-xr-x 2 root 4096 May 27 2011-3

Drwxr-xr-x 2 root 4096 May 27 2011-4

Drwxr-xr-x 2 root 4096 May 27 2011-5

Drwxr-xr-x 2 root 4096 May 27 2011-6

Drwxr-xr-x 2 root 4096 May 27 2011-7

Drwxr-xr-x 2 root 4096 May 27 2011-8

Drwxr-xr-x 2 root 4096 May 27 2011-9

[Root @ allyes20121031 shell_study] #

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.