atomrus1993

stepic bash students

Nov 15th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.28 KB | None | 0 0
  1. if [[ -n "$1" && "$1" -gt "0" ]] # $1 не null и больше нуля
  2. then
  3.  
  4. if [[ $1 -ge 5 ]] # $1 больше 5ти
  5. then
  6.     echo "A lot of students"
  7. elif [[ $1 -eq 1 ]] # $1 равно 1
  8. then
  9.     echo "1 student"
  10. else
  11.     echo "$1 students"
  12. fi
  13.  
  14. else
  15.     echo "No students"
  16. fi
Advertisement
Add Comment
Please, Sign In to add comment