diff --git a/01-read_input_COPY b/01-read_input_COPY new file mode 100644 index 00000000..333f4f5a --- /dev/null +++ b/01-read_input_COPY @@ -0,0 +1,26 @@ +#!/bin/bash +# read the name of the user and print hello + +echo "Hello! What is your name" +read name +echo "Welcome, $name" + +# single quotes prevent the expansion of the variable +echo 'Your name was stored in $name' + +# exercise: write a script that asks the user for a +# filename and create an empty file named after it + +echo "$name, type in a name for a new file" +read filename +echo "Thank you. Creating a file named $filename" +touch $filename.txt +echo "File $filename created." + +echo "$name, what flavor of icecream do you like, chocolate or vanilla?" +read flavor +if [ "$flavor" = "chocolate" ]; then + echo "Here is a virtual chocolate ice cream cone! <3" +else + echo "Sorry, I don't rock with vanilla. Game Over." +fi diff --git a/01-test-file.txt b/01-test-file.txt new file mode 100644 index 00000000..e69de29b diff --git a/03-happy_COPY.sh b/03-happy_COPY.sh new file mode 100644 index 00000000..d2e1c8fa --- /dev/null +++ b/03-happy_COPY.sh @@ -0,0 +1,49 @@ +#!/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 "What day is today in the week? (Ex. Monday, Tuesday, etc.)" +read day + +while true; do + echo "What day is today in the week? (Ex. Monday, Tuesday, etc.)" + read day + + if [ "$day" = "Monday" ]; then + echo "Not the weekend yet :(" + break + elif [ "$day" = "Tuesday" ]; then + echo "Not the weekend yet :(" + break + elif [ "$day" = "Wednesday" ]; then + echo "Not the weekend yet :(" + break + elif [ "$day" = "Thursday" ]; then + echo "Not the weekend yet :(" + break + elif [ "$day" = "Friday" ]; then + echo "Thank God it's Friday! ^^" + break + elif [ "$day" = "Saturday" ]; then + echo "It's the weekend! Time to relax :)" + break + elif [ "$day" = "Sunday" ]; then + echo "It's the weekend! Time to relax :)" + break + else + echo "You didn't type the day in correctly... Try again :/" + fi +done \ No newline at end of file diff --git a/after-merge.jpg b/after-merge.jpg new file mode 100644 index 00000000..ee901f62 Binary files /dev/null and b/after-merge.jpg differ diff --git a/ice-cream.txt b/ice-cream.txt new file mode 100644 index 00000000..e69de29b