0
0
Bash Scriptingscripting~10 mins

First Bash script in Bash Scripting - Mini Project: Build & Apply

Choose your learning style9 modes available
First Bash script
📖 Scenario: You want to create a simple Bash script that greets a user by name. This is like writing a short note to a friend, but using a computer script.
🎯 Goal: Build a Bash script that stores a name in a variable, stores a greeting message, combines them, and then prints the full greeting.
📋 What You'll Learn
Create a variable called name with the value "Alice"
Create a variable called greeting with the value "Hello"
Create a variable called message that combines greeting and name with a space in between
Print the message variable to the terminal
💡 Why This Matters
🌍 Real World
Bash scripts like this are used to automate simple tasks like sending greetings, setting up environments, or running commands with variables.
💼 Career
Knowing how to write basic Bash scripts is useful for system administrators, developers, and anyone working with Linux or Unix systems.
Progress0 / 4 steps
1
Create the name variable
Create a variable called name and set it to the string "Alice".
Bash Scripting
Need a hint?

Use name="Alice" to create the variable.

2
Create the greeting variable
Add a variable called greeting and set it to the string "Hello".
Bash Scripting
Need a hint?

Use greeting="Hello" to create the variable.

3
Combine greeting and name into message
Create a variable called message that combines greeting and name with a space between them. Use message="$greeting $name".
Bash Scripting
Need a hint?

Use message="$greeting $name" to combine the variables.

4
Print the message
Print the message variable to the terminal using echo.
Bash Scripting
Need a hint?

Use echo "$message" to print the message.