forked from RahafB/bash_basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path05-grade.sh
More file actions
36 lines (30 loc) · 868 Bytes
/
05-grade.sh
File metadata and controls
36 lines (30 loc) · 868 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
35
#!/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 "Hello there im from a different universe"
echo "what is the temperature outside"
echo "give a numeric answer"
read temp
if [ "$temp" -lt 40 ]; then
echo "It's cold"
elif [ "$temp" -lt 60 ]; then
echo "It's chilly"
elif [ "$temp" -lt 70 ]; then
echo "It's great"
else
echo "It's Scorching hot"
fi