diff --git a/01-read_input_woody.sh b/01-read_input_woody.sh new file mode 100644 index 00000000..acc1e5b6 --- /dev/null +++ b/01-read_input_woody.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# read the name of the user and print hello + +echo "Hello! What is your name?" +read woody +echo "Welcome, $woody" + + +echo 'Your name was stored in $woody' + +# asking for a filename +echo "Please enter a filename:" +read filewoody + +# creating an empty file with the specified name +touch "$filewoody" + +echo "An empty file named '$filewoody' has been created." \ No newline at end of file diff --git a/bash_basics/01-read_input.sh b/bash_basics/01-read_input.sh new file mode 100644 index 00000000..59105c6e --- /dev/null +++ b/bash_basics/01-read_input.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# read the name of the user and print hello + +echo "Hello! What is your name" +read name +echo "Your full name is $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 diff --git a/screen-shot-github.jpg b/screen-shot-github.jpg new file mode 100644 index 00000000..e380773f Binary files /dev/null and b/screen-shot-github.jpg differ diff --git a/screenshot0.jpg b/screenshot0.jpg new file mode 100644 index 00000000..4c78f39f Binary files /dev/null and b/screenshot0.jpg differ