diff --git a/01-read_input_SLE.sh b/01-read_input_SLE.sh new file mode 100644 index 00000000..76a8612a --- /dev/null +++ b/01-read_input_SLE.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# read the name of the user and print hello + +echo "Hello! What is your name" +read name +echo "Welcome, $name - from Sebastian Londono E." + +# 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 "Hey $name, What is your filename?" +read filename +echo "You want $filename" +echo "Creating $filename ..." +touch $filename +echo "$filename created" +ls +echo "Bye,bye" diff --git a/02-add_nums.sh b/02-add_nums.sh index e8554d9d..fa098dbe 100644 --- a/02-add_nums.sh +++ b/02-add_nums.sh @@ -1,19 +1,19 @@ #!/bin/sh -echo "Enter your first number" -read first -echo "Enter your second number" -read second -echo "Enter your third number" +echo "Enter first number: " +read num1 +echo "Enter second number: " +read num2 +echo "Enter your third number: " read third sum=$(( first+second+third )) echo "The sum is $sum" -echo "Please enter the height" +echo "Please enter the height: " read height -echo "Please enter the width" +echo "Please enter the width: " read width totalPixels=$(( height*width )) @@ -33,3 +33,7 @@ read height echo "" pixelTotal=$(( $width * $height )) echo "Your display has ${pixelTotal} pixels." + +# Exercise +product=$(( num1 * num2 * third )) +echo "The product of your numbers is $product" diff --git a/merged.png b/merged.png new file mode 100644 index 00000000..fd57ccbb Binary files /dev/null and b/merged.png differ diff --git a/print_name.sh b/print_name.sh new file mode 100644 index 00000000..13a20f0f --- /dev/null +++ b/print_name.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "Hello, my name is Sebastian Londono Escobar!" \ No newline at end of file