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
12 changes: 12 additions & 0 deletions 01-read_Test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# read the name of the user and print hello

echo "Hello! Joel"
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
12 changes: 9 additions & 3 deletions 03-happy.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
#!/bin/sh

echo "You are happy?"
<<<<<<< HEAD
echo "Is today the weekend? (yes/no)"
=======
echo "Is today the not weekend? (yes/no)"
>>>>>>> parallel
read answer

if [ "$answer" = "yes" ]; then
echo "Smile :)"
echo "You are correct :)"
else
echo "Still Smile :)"
echo "You are not correct :("
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

Binary file added gitMergeSc.JPG
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 gitSc.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.