Shell scripting Exercises (12.12)

Source: Internet
Author: User

Write a script, create a folder, enter a folder, and then use the loop to create a sequential file in the folder


Idea: 1. Create the specified folder and go to the folder

2. Specify a variable with a value of 0 to allow this variable to be recycled

3. Create one document at a time for Each loop until the end of the loop


Vim create.sh


#!/bin/bash

#written by Lizheng

#about Create File

CD ~

mkdir testfile

CD testfile

for ((i=0; i<10; i++)); Do

Touch Testfile_$i.txt

Done



650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8B/76/wKioL1hOvXXzEE10AAAdURUYe9c374.png-wh_500x0-wm_3 -wmp_4-s_1116217657.png "title=" 41.png "alt=" Wkiol1hovxxzee10aaaduruye9c374.png-wh_50 "/>


SH create.sh


650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s2.51cto.com/wyfs02/m02/8b/76/wkiol1hovygxafytaaasuqgbjr0722.png-wh_500x0-wm_3-wmp_4-s_1472753806.png "title = "42.png" alt= "Wkiol1hovygxafytaaasuqgbjr0722.png-wh_50"/>




Shell scripting Exercises (12.12)

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.