Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added branch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions my_03-happy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

echo "You are happy?"
read answer

if [ "$answer" = "yes" ]; then
echo "Smile :)"
else
echo "Still Smile :)"
fi

# 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 "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
10 changes: 10 additions & 0 deletions my_copy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

echo "Hello My Tran!"
echo "How old are you?"
read age
echo 'Thanks My! I see you are ' $age ' years old'

echo "What school do you currently attend?"
read school
echo 'Nice! ' $school ' sounds like a great place to learn.'