Shell Programming Examples

Source: Internet
Author: User

1. Create 100 folders in the/home folder. The folder name is a1......a100 in turn.
2. Write a script. Own initiative will be under the Household folder under all files less than 5KB package into XX.tar.gz. (Hint: use LS. Grep,find and other orders. Documents generally refer to ordinary documents)
3. Write a program that can take out the first column of/ET/PASSWD, and each column is displayed with a line of string "The 1 account is" root "
4. Write a program whose role is to check the existence of the/root/test/logical name first. If it does not exist, a file is created.

Use touch to create, leave after creation, and if present, infer whether the name is a file. If the file is deleted, create a new folder. The file name is called Loglical. Delete this folder if it exists, and if the name is a folder.
5. Write a shell script. Read in 10 numbers from the keyboard. Displays the maximum and minimum values.


6. Write a script to print the multiplication table regardless of the number. Print If you enter 3
1*1=1
2*1=2 2*2=4
3*1=3 3*2=6 3*3=9

7. Write a script to enter your own birthday time (YYYYMMDD). Calculate how many days the number of hours is your birthday.



Each instance is written by itself by looking for information. Did learn a lot of things.

Shell Programming Examples

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.