forked from GGC-SD/bash_basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path05-grade.sh
More file actions
34 lines (29 loc) · 807 Bytes
/
05-grade.sh
File metadata and controls
34 lines (29 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
echo "What did you get in the first ITEC 3860 test?"
echo "Please give a numeric answer"
read grade
if [ $grade -ge 90 ]; then
echo "You got an A. Nice."
elif [ $grade -ge 80 ]; then
echo "You got a B. That's good."
elif [ $grade -ge 70 ]; then
echo "You got a C. Not bad."
else
echo "Time to work on some extra credit assignments"
fi
# exercise: write a script (that utilizes weather-util)
# that prints "it's cold" if the temperature is < 40
# it's chilly if < 60, it's okay if < 70 and, it's hot for
# everything else
echo "What is the temperature outside?"
echo "Give a numerical answer:"
read temp
if [ $temp -le 40 ]; then
echo "it's cold"
elif [ $temp -le 60 ]; then
echo "it's chilly"
elif [ $temp -le 70 ]; then
echo "it's okay"
else
echo "it's hot"
fi