Script-if is used to determine a student's score based on the student's score

Source: Internet
Author: User
If the score is 1-59, you must retake 60-79, good 80-90, excellent 90-100, and receive a scholarship.

 

#! /Bin/bash

Read-P "Enter your score" sta

 

If [-Z $ sta]

Then

Echo "You did not enter the score"

Read-P "Enter your score" sta

If [-Z $ sta]

Then

Echo "You did not enter the score"

Exit

Fi

Fi

If [$ sta-ge 1] &>/dev/null & [$ sta-Le 59]

Then

Echo "retake"

Elif [$ sta-ge 60] &>/dev/null & [$ sta-Le 79]

Then

Echo "good"

Elif [$ sta-ge 80] &>/dev/null & [$ sta-Le 90]

Then

Echo "excellent"

Elif [$ sta-ge 91] &>/dev/null & [$ sta-Le 100]

Then

Echo "Scholarship"

Else

Echo "Enter your score (1 ~ 100 )"

Fi


Script-if is used to determine a student's score based on the student's score

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.