forked from GGC-SD/bash_basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03-happy.sh
More file actions
27 lines (22 loc) · 669 Bytes
/
03-happy.sh
File metadata and controls
27 lines (22 loc) · 669 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
#!/bin/sh
echo "You are happy?"
read answer
if [ "$answer" = "yes" ]; then
echo "Smile :)"
else
echo "Still Smile :)"
fi
echo "hellooo? How are you today?"; echo "come again? Oh- I'm great!"
# here are the other string comparison operators
# != , -n (not an empty string) , -z (an empty string)
# exercise: write a script that prints whether today is
# the weekend or not
echo -n "Hello World"
echo "Which day of a week is today?"
read day
if [[ ${day,,} == "saturday" ]] | [[ ${day,,} == "sunday" ]]
then
echo "Horayyyy!! Today is the weekend. Enjoy yourself! Be ready for the next week."
else
echo "Today is a weekday. Keep focus on your work."
fi