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
25 changes: 25 additions & 0 deletions 03-devin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
echo "Welcome, this script was edit by Devin"

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
25 changes: 10 additions & 15 deletions 03-happy.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
#!/bin/sh
#!/bin/bash

echo "You are happy?"
echo "Are you happy today?"
read answer

if [ "$answer" = "yes" ]; then
echo "Smile :)"
echo "Awesome, keep smiling :)"
else
echo "Still Smile :)"
echo "Smile anyway :)"
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?"
echo "Which day of the 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."

if [[ ${day,,} == "saturday" || ${day,,} == "sunday" ]]; then
echo "Nice! It's the weekend."
else
echo "It's a weekday. Stay focused."
fi
Binary file added after-merging.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 two-branches.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.