diff --git a/06-infinite.sh b/06-infinite.sh index 953bb98..5152756 100644 --- a/06-infinite.sh +++ b/06-infinite.sh @@ -3,10 +3,23 @@ # 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 +# while [ true ]; do +# echo "infinite number of beer on the wall" +# done # exercise: write a script that continues to look up # the ip address of a given hostname (using nslookup) until # the user decides to stop + +while true; do + echo "Enter a hostname to look up (or type 'exit' to quit):" + read hostname + + if [ "$hostname" = "exit" ]; then + echo "Exiting script." + break + fi + + nslookup "$hostname" + echo "" +done \ No newline at end of file diff --git a/BRANCHES.png b/BRANCHES.png new file mode 100644 index 0000000..0a1ab3b Binary files /dev/null and b/BRANCHES.png differ diff --git a/gitassignment.sh b/gitassignment.sh new file mode 100755 index 0000000..48b3be1 --- /dev/null +++ b/gitassignment.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# read the name of the user and print hello + +echo "Hello! Hugo!"