Variables and Quoting
Part of the Bash course
If you have never used a variable before, do not worry. It is one of the simplest ideas in this whole course, and Bash's version of it is about as plain as it gets. This lesson also covers quoting, which trips up almost everyone once, and then never again once it clicks.
A variable is just a name that stands in for a piece of text. Think of it like a sticky note: you write "today" on the note, stick it to a piece of paper that says "13 May 2026", and from then on, whenever you see the note "today", you know what it really means. In Bash, that sticky note is the variable name, and the paper underneath is the value. ...
Want to learn Bash Variables and Quoting in a real environment?
Click below, get a fresh Linux box with Bash ready to go, and work through Variables and Quoting hands-on with an AI tutor that knows your code.
Start this lessonVariables and QuotingWhat you'll learn
- Variable assignment
- Double quotes vs single quotes
- ${var} braces
- Command substitution $(...)
Read this lesson in your language
All lessons in this course
12 lessons- 1What Is Bash20 min
- 2Shebang and Your First Script25 min
- 3Variables and Quoting25 min
- 4Conditionals and Tests30 min
- 5Loops25 min
- 6Functions25 min
- 7Arrays25 min
- 8String and Arithmetic Expansion25 min
- 9IO Redirection and Pipes25 min
- 10Error Handling and Traps30 min
- 11Debugging and Best Practices25 min
- 12Capstone: Server Bootstrap Script60 min
