Accessing variables ($var and ${var}) in Bash scripting
📖 Scenario: You are writing a simple bash script to greet users and show their favorite fruit. You want to learn how to use variables correctly in bash scripts.
🎯 Goal: Build a bash script that stores a user's name and favorite fruit in variables, then prints a greeting using both $var and ${var} syntax.
📋 What You'll Learn
Create variables with exact names and values
Use both $var and ${var} syntax to access variables
Print the greeting message exactly as instructed
💡 Why This Matters
🌍 Real World
Using variables is essential in bash scripts to store and reuse information like user input, file names, or configuration values.
💼 Career
Knowing how to access variables correctly is a fundamental skill for system administrators, DevOps engineers, and anyone automating tasks with shell scripts.
Progress0 / 4 steps