Shell Programming Topic Exercises

Source: Internet
Author: User

1. Write the shell script, calculate 1-100 's and;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/B2/wKiom1XWy-eBa3uqAAENi2u4ldc587.jpg "title=" 1.jpg " alt= "Wkiom1xwy-eba3uqaaeni2u4ldc587.jpg"/>

2. Write the shell script, ask for a number, and then calculate from 1 to the input number and, if the input number is less than 1 re-input until the correct number is entered;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/AE/wKioL1XWzl7hNrS7AAE01lOZDng284.jpg "title=" 2.jpg " alt= "Wkiol1xwzl7hnrs7aae01lozdng284.jpg"/>

3. Write the shell script to copy all directories under the/root/directory (only one level) to the/tmp/directory;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/B2/wKiom1XWzQCy-DmLAAELCTRcAB8986.jpg "title=" 3.jpg " alt= "Wkiom1xwzqcy-dmlaaelctrcab8986.jpg"/>

4. Write shell scripts, batch build user user_00, user_01, ... user_100 and all users belong to the Users group;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/B2/wKiom1XWznLxqNrpAAEu8idttj4634.jpg "title=" 4.jpg " alt= "Wkiom1xwznlxqnrpaaeu8idttj4634.jpg"/>

5. Write a shell script that intercepts the first column in the line containing the keyword ' abc ' in the file Test.log (assuming the delimiter is ":"), then sorts the intercepted numbers (assuming the first column is a number) and prints out the columns with more than 10 repetitions;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/AF/wKioL1XW09LgcsqDAAE3Do3V-9M733.jpg "title=" 5.jpg " alt= "Wkiol1xw09lgcsqdaae3do3v-9m733.jpg"/>

6. Write the shell script to determine whether the IP input is correct (IP rules are, N1.N2.N3.N4, where 1<n1<255, 0<n2<255, 0<n3<255, 0<n4<255).

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/AF/wKioL1XW1CKRs0OGAAHJPjfR_lE440.jpg "title=" 6.jpg " alt= "Wkiol1xw1ckrs0ogaahjpjfr_le440.jpg"/>


This article from "Samoyed sadness" blog, declined reprint!

Shell Programming Topic Exercises

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.