Variable assignment (no spaces around =)
📖 Scenario: You are writing a simple bash script to store and display your favorite fruit.
🎯 Goal: Create a variable to hold the name of your favorite fruit and then print it.
📋 What You'll Learn
Create a variable called
fruit with the value Apple using no spaces around the = sign.Create a variable called
count with the value 3 using no spaces around the = sign.Use a variable called
total to store the sum of count and 2.Print the value of
fruit and total.💡 Why This Matters
🌍 Real World
Bash scripts often use variables to store data like file names, counts, or user input. Correct variable assignment is essential for scripts to work.
💼 Career
Many IT and DevOps jobs require writing bash scripts for automation. Knowing how to assign and use variables correctly is a basic but crucial skill.
Progress0 / 4 steps