Linux Experiment--shell Programming

Source: Internet
Author: User

Reprint Please specify: Http://blog.csdn.net/wujysh


1. View the values of the environment variables defined by the user shell under the current system.
2. Define the value of the variable AK to 200 and display it on the screen.
3. Define the value of the variable AM to 100, and use the test command to compare whether its value is greater than 150.
4, create a simple shell program, its function is:
1) Change the host name to your initials;
2) Displays the computer hostname and displays the system date and time.
5. Use the If-then-else statement to create a shell program that determines whether a score is passed according to the input score.
6. Use the For statement to create shell programs that seek the sum of all the integers on the command line.
7. Use the While statement to create a shell program that calculates the square of 1 to 5.
8. Use the While statement to create a shell program that is additive and (1+2+3+4+...+n) based on the numeric value entered.
9. Use the For statement to create a shell program with the function 1+2+3+4+5+...+n.
10. Use the until statement to create a shell program whose function is to calculate the square of the 1~10.
11, design a shell program, in the/home directory to establish 100 directories, that is, xxx1~xxx100, and set
Permissions for each directory where the file owner's permissions are read, write, execute, and the permissions of the group where the file owner resides
For: Read, execute; Other user's permissions are: Read, execute;
12. Write shell program to automatically delete the function of 50 accounts in the 1th question. The account name is XXX1 to XXX50;
13, write a shell program, requirements: According to the student score from the keyboard input, display the corresponding grade, which
60 points Below is "failed!", 60-70 is divided into "passed!", 70-80 is divided into "medium!", 80-90 is divided into
"Good!", 90-100 is "excellent!".
14, a system administrator to do a certain amount of repetitive work every day, please follow the following requirements, to develop a solution:
(1) Delete all subdirectories and all files under the/ABC directory at 4:50;
(2) Every Monday 5:50 archive and compress all directories and files in the/data directory into files:
backup.tar.gz;
(3) Unmount the CD-ROM of the IDE interface at 5:55 (assuming that the device name of the CD-ROM is hdc);
(4) Start up in the morning after booting.
15, design a shell program,
See if there is a directory named xxx80~xxx90 in the/home directory,
Remove them. Note: Do not delete other directories;
16, design a shell program, add a new group Testgroup, and then add 30 users belonging to this group, the user
The form of the name of XXX??, Which?? from 01 to 30.

Linux Experiment--shell Programming

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.