Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OperationOf_if_for_while_etc #3

Open
linrio opened this issue Jun 29, 2016 · 0 comments
Open

OperationOf_if_for_while_etc #3

linrio opened this issue Jun 29, 2016 · 0 comments

Comments

@linrio
Copy link
Owner

linrio commented Jun 29, 2016

SHELL Script

  1. if
#! /bin/bash

read -p "Please input your score: " a 
if ((a < 60)) ; then
    echo "You didn`t pass the exam."
else
    echo "good! You passed the exam."
fi
  1. elif
#! /bin/bash

read -p "Please input your score: " a 
if ((a < 60)) ; then
    echo "You didn`t pass the exam."
elif ((a > 60)) && ((a < 85)); then
    echo "Good! You passed the exam."
else
    echo "Very good! Your score is very high!"
fi

-lt ( < )(小于),-gt ( > )(大于),-le ( <= )(小于等于),-ge ( => )(大于等于),-eq ( = )(等于),-ne ( != )(不等于)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant