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
21 changes: 21 additions & 0 deletions 01-read_input_SLE.sh
Original file line number Diff line number Diff line change
@@ -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"
18 changes: 11 additions & 7 deletions 02-add_nums.sh
Original file line number Diff line number Diff line change
@@ -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 ))
Expand All @@ -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"
Binary file added merged.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions print_name.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
echo "Hello, my name is Sebastian Londono Escobar!"