diff --git a/01-read-input_copy_cli.sh b/01-read-input_copy_cli.sh new file mode 100644 index 00000000..2cb55a5e --- /dev/null +++ b/01-read-input_copy_cli.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +echo "Hello Steven Lopez!" +echo "How old are you?" +read age +echo 'Thanks Steven! 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.' diff --git a/01-read_input.sh b/01-read_input_ADM.sh similarity index 65% rename from 01-read_input.sh rename to 01-read_input_ADM.sh index 438445b4..314c287b 100644 --- a/01-read_input.sh +++ b/01-read_input_ADM.sh @@ -10,3 +10,12 @@ 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 "Hey $name, What is your filename?" +read filename +echo "You want $filename" +echo "Creating $filename ..." +touch $filename +echo "$filename creted" +ls +echo "Bye,bye" diff --git a/02-add_nums.sh b/02-add_nums.sh index 2fd13cb5..e8554d9d 100644 --- a/02-add_nums.sh +++ b/02-add_nums.sh @@ -11,5 +11,25 @@ sum=$(( first+second+third )) echo "The sum is $sum" +echo "Please enter the height" +read height +echo "Please enter the width" +read width + +totalPixels=$(( height*width )) + +echo "The total number of pixels is $totalPixels" + # exercise: ask the user for the width and height and present total # number of pixels + +echo "" +echo "What is the width of your display?" +read width +echo "" +echo "What is the height of your display?" +read height + +echo "" +pixelTotal=$(( $width * $height )) +echo "Your display has ${pixelTotal} pixels." diff --git a/03-happy.sh b/03-happy.sh index 8095d30e..caa24718 100644 --- a/03-happy.sh +++ b/03-happy.sh @@ -14,3 +14,11 @@ fi # 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 \ No newline at end of file diff --git a/06-infinite.sh b/06-infinite.sh index 953bb98b..cb2a40cc 100644 --- a/06-infinite.sh +++ b/06-infinite.sh @@ -3,10 +3,47 @@ # the if statement had, if-then-fi # while loop has, while-do-done # true and false are also Unix commands -while [ true ]; do - echo "infinite number of beer on the wall" -done + +echo "Network Tools Menu" +echo "1. IP Address Lookup Tool" +echo "2. Network Ping Monitor" +echo -n "Choose an option (1 or 2): " +read choice + +if [ "$choice" = "1" ]; then + echo "IP Address Lookup Tool" + continue_lookup=true + while [ "$continue_lookup" = true ]; do + echo -n "Enter a hostname to lookup: " + read hostname + echo "Looking up $hostname..." + nslookup "$hostname" + echo -n "Do you want to lookup another hostname? (y/n): " + read answer + if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then + continue_lookup=false + echo "Goodbye!" + fi + done +elif [ "$choice" = "2" ]; then + echo "Network Ping Monitor" + echo -n "Enter a hostname to continuously ping: " + read hostname + echo "Starting continuous ping to $hostname (Press Ctrl+C to stop)" + while [ true ]; do + ping -n 1 "$hostname" > /dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "✓ $hostname is reachable at $(date)" + else + echo "✗ $hostname is NOT reachable at $(date)" + fi + sleep 2 + done +else + echo "Invalid choice. Goodbye!" +fi + # exercise: write a script that continues to look up # the ip address of a given hostname (using nslookup) until -# the user decides to stop +# the user decides to stop \ No newline at end of file diff --git a/07-beer.sh b/07-beer.sh index c03aded6..b0b033ce 100644 --- a/07-beer.sh +++ b/07-beer.sh @@ -22,3 +22,24 @@ done # exercise: implement another counting song (such as 12 days of Christmas) # using loops and if statements. + +echo "Now we sing about monkeys jumping on the bed" +echo "How many monkeys?" +read count + +while [ $count -ge 0 ]; do + if [ $count -ge 2 ]; then + echo "$count little monkeys jumping on the bed" + echo "one fell off and bumped his head" + echo "Moma called the doctor and the doctor said" + echo "No more monkeys jumping on the bed!" + else + echo "$count little monkey jumping on the bed" + echo "He fell off and bumped his head" + echo "Moma called the doctor and the doctor said" + echo "No more monkeys jumping on the bed!" + fi + + ((count = count - 1)) + +done diff --git a/09-name.sh b/09-name.sh index b9b330d0..927672e4 100644 --- a/09-name.sh +++ b/09-name.sh @@ -2,7 +2,7 @@ # look up ip addresses of various search engines -servers="yahoo.com google.com dogpile.com wolframalpha.com" +servers="github.com youtube.com twitter.com reddit.com" for server in $servers; do nslookup $server @@ -12,3 +12,9 @@ done # exercise: Change the list of servers and also the # operation applied to them. For instance, use ping, # traceroute, or nslookup with other options. + +for server in $servers; do + ping $server + echo "----------------------------" +done + diff --git a/12-monkeys.sh b/12-monkeys.sh new file mode 100644 index 00000000..fe5540b6 --- /dev/null +++ b/12-monkeys.sh @@ -0,0 +1,20 @@ +# exercise: implement another counting song (such as 12 days of Christmas) +# using loops and if statements. + +echo "Now, let's sing monkey jumping on the bed." +echo "How many monkeys are jumping on the bed?" +read number +while [ $number -ge 0 ]; do + if [ $number -ge 2 ]; then + echo "$number little monkeys jumping on the bed. One fell off and bumped its head." + echo "Momma called the doctor and the doctor said, 'No more Monkeys jumping on the bed!'" + elif [ $number -ge 1 ]; then + echo "$number little monkeys jumping on the bed. One fell off and bumped its head." + echo "Momma called the doctor and the doctor said, 'No more Monkeys jumping on the bed!'" + else + echo "No more monkeys jumping on the bed." + fi + + ((number = number - 1)) +done + #statements diff --git a/13-RNG.sh b/13-RNG.sh new file mode 100644 index 00000000..869621f6 --- /dev/null +++ b/13-RNG.sh @@ -0,0 +1,26 @@ +#!/bin/bash +echo "Taisann Kham" +echo "Hello, welcome to Taisann's RNG guessing game" +echo "Please choose a number between 0 - 9" +RANGE=10 +rand=0 +rand=$RANDOM +let "rand %= $RANGE" +read input +loop=false +while [[ $loop != q ]]; do + if [[ $input -lt $rand ]]; then + echo "Your number is smaller than the correct number" + fi + if [[ $input -gt $rand ]]; then + echo "Your number is bigger than the correct number" + fi + if [[ $input -eq $rand ]]; then + loop=q + echo "Congratulations! You guessed the correct number, $rand!" + fi + if [[ $loop != q ]]; then + echo "Please choose a new number" + read input + fi +done diff --git a/Emree_Jensen/Emree_Jensen.sh b/Emree_Jensen/Emree_Jensen.sh new file mode 100644 index 00000000..75000094 --- /dev/null +++ b/Emree_Jensen/Emree_Jensen.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "Hello, my name is Emree Jensen!" diff --git a/GH-Network-Parallels.png b/GH-Network-Parallels.png new file mode 100644 index 00000000..87d614d7 Binary files /dev/null and b/GH-Network-Parallels.png differ diff --git a/GitBranchGraph-AfterMerging.png b/GitBranchGraph-AfterMerging.png new file mode 100644 index 00000000..2fec5dbe Binary files /dev/null and b/GitBranchGraph-AfterMerging.png differ diff --git a/GitBranchGraph.PNG b/GitBranchGraph.PNG new file mode 100644 index 00000000..21216771 Binary files /dev/null and b/GitBranchGraph.PNG differ diff --git a/GitBranchGraphTwo.PNG b/GitBranchGraphTwo.PNG new file mode 100644 index 00000000..2c88c454 Binary files /dev/null and b/GitBranchGraphTwo.PNG differ diff --git a/GitHub_Network_Pic_1.PNG b/GitHub_Network_Pic_1.PNG new file mode 100644 index 00000000..2c7bf26c Binary files /dev/null and b/GitHub_Network_Pic_1.PNG differ diff --git a/GitHub_Network_Pic_2.PNG b/GitHub_Network_Pic_2.PNG new file mode 100644 index 00000000..7756646e Binary files /dev/null and b/GitHub_Network_Pic_2.PNG differ diff --git a/Github-p2-conflict-resolution.png b/Github-p2-conflict-resolution.png new file mode 100644 index 00000000..65e0f8c9 Binary files /dev/null and b/Github-p2-conflict-resolution.png differ diff --git a/Ryan_Gambrell/ryans_bash_script.sh b/Ryan_Gambrell/ryans_bash_script.sh new file mode 100644 index 00000000..ca2543c8 --- /dev/null +++ b/Ryan_Gambrell/ryans_bash_script.sh @@ -0,0 +1,15 @@ +#/bin/bash +echo "My name is Ryan Peyton Gambrell" +echo "Welcome to Dr. Anca Doloc-Mihu's Software Development II class." +echo "" +echo "Here is my half pyramid." +echo "" +for outerStar in {1..6} +do + while [ $outerStar -gt 0 ] + do + echo -n "*" + ((outerStar--)) + done + echo "" +done diff --git a/Thanh_Tran/Thanh_Tran_script_bash.sh b/Thanh_Tran/Thanh_Tran_script_bash.sh new file mode 100644 index 00000000..f80f0c32 --- /dev/null +++ b/Thanh_Tran/Thanh_Tran_script_bash.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +echo "Hello! My name is Thanh Tran." +echo "Welcome to my first bash program! What is your name?" +read name +echo "Hi, $name . Nice to see you. Let play a game" + +echo "What is the closest planet to the Sun?" +read planet + +while [[ "${planet,,}" != "mercury" ]] +do + echo "Incorrect. Please guess again." + read planet +done + +echo "You got the right answer! Bye bye. See you again." \ No newline at end of file diff --git a/after-merging.PNG b/after-merging.PNG new file mode 100644 index 00000000..438bbc5a Binary files /dev/null and b/after-merging.PNG differ diff --git a/github_netowork_graph.png b/github_netowork_graph.png new file mode 100644 index 00000000..8c62d3b1 Binary files /dev/null and b/github_netowork_graph.png differ diff --git a/github_netowork_graph_conflict_merged.png b/github_netowork_graph_conflict_merged.png new file mode 100644 index 00000000..08f45c28 Binary files /dev/null and b/github_netowork_graph_conflict_merged.png differ diff --git a/josephShanahan.sh b/josephShanahan.sh new file mode 100644 index 00000000..76c90530 --- /dev/null +++ b/josephShanahan.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# read the name of the user and print hello + +echo "Hello! My name is Joseph Shanahan." +echo "I hope you are having a great day!!!" +msg="Would you like to see the hidden message? Please enter '1' for YES or '0' for NO." +echo $msg +read input +loop=false +while [[ $loop == false ]]; do + if [[ $input == 1 ]]; then + echo "Hello there!" + sleep 5s + loop=true + elif [[ $input == 0 ]]; then + echo $msg + read input + fi +done diff --git a/khendricks/nameAndCountdown.sh b/khendricks/nameAndCountdown.sh new file mode 100644 index 00000000..12a5f593 --- /dev/null +++ b/khendricks/nameAndCountdown.sh @@ -0,0 +1,10 @@ +#!/bin/bash +name=Kris +echo "Hello $name, isn't it a beautiful day to git?" +echo "Exiting in..." +for (( counter=10; counter>0; counter--)) +do +sleep 1s +echo -n "$counter " +done +printf "\n" \ No newline at end of file diff --git a/two-branches.PNG b/two-branches.PNG new file mode 100644 index 00000000..b9591e5d Binary files /dev/null and b/two-branches.PNG differ