18 Variables & Expansion questions from the Bash bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.
Free to start: the 2-minute IT readiness check — six questions and a result.
A.binding a name to a value with the equals sign, which must have no surrounding whitespace or the shell treats the name as a command
B.retrieving and optionally transforming a variable's value using brace syntax, supporting defaults, substring slicing, and pattern removal
C.a quoting style that preserves every enclosed character literally, with no variable, history, or backslash interpretation at all
D.a quoting style that prevents word splitting and globbing while still allowing variable and dollar-substitution to occur inside
Answer + AI explanation with Pro
2. Which term means: "binding a name to a value with the equals sign, which must have no surrounding whitespace or the shell treats the name as a command"?
Junior
A.Double quoting
B.Parameter expansion
C.Command substitution
D.Variable assignment
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.Variable assignment — a construct that runs a command and replaces itself with that command's output, written with a dollar sign followed by parentheses
B.Variable assignment — a brace form that yields a fallback string when a parameter is unset or empty, written with a colon-dash between name and fallback
C.Variable assignment — binding a name to a value with the equals sign, which must have no surrounding whitespace or the shell treats the name as a command
D.Variable assignment — a quoting style that preserves every enclosed character literally, with no variable, history, or backslash interpretation at all
Answer + AI explanation with Pro
4. What is Command substitution?
Junior
A.a quoting style that prevents word splitting and globbing while still allowing variable and dollar-substitution to occur inside
B.a construct that runs a command and replaces itself with that command's output, written with a dollar sign followed by parentheses
C.binding a name to a value with the equals sign, which must have no surrounding whitespace or the shell treats the name as a command
D.a quoting style that preserves every enclosed character literally, with no variable, history, or backslash interpretation at all
Answer + AI explanation with Pro
5. Which term means: "a construct that runs a command and replaces itself with that command's output, written with a dollar sign followed by parentheses"?
Junior
A.Double quoting
B.Default value expansion
C.Parameter expansion
D.Command substitution
Answer + AI explanation with Pro
6. Which statement is correct?
Junior
A.Command substitution — a brace form that yields a fallback string when a parameter is unset or empty, written with a colon-dash between name and fallback
B.Command substitution — binding a name to a value with the equals sign, which must have no surrounding whitespace or the shell treats the name as a command
C.Command substitution — a quoting style that prevents word splitting and globbing while still allowing variable and dollar-substitution to occur inside
D.Command substitution — a construct that runs a command and replaces itself with that command's output, written with a dollar sign followed by parentheses
Answer + AI explanation with Pro
7. What is Parameter expansion?
Mid
A.retrieving and optionally transforming a variable's value using brace syntax, supporting defaults, substring slicing, and pattern removal
B.a brace form that yields a fallback string when a parameter is unset or empty, written with a colon-dash between name and fallback
C.binding a name to a value with the equals sign, which must have no surrounding whitespace or the shell treats the name as a command
D.a quoting style that prevents word splitting and globbing while still allowing variable and dollar-substitution to occur inside
Answer + AI explanation with Pro
8. Which term means: "retrieving and optionally transforming a variable's value using brace syntax, supporting defaults, substring slicing, and pattern removal"?
Mid
A.Variable assignment
B.Double quoting
C.Parameter expansion
D.Command substitution
Answer + AI explanation with Pro
9. Which statement is correct?
Mid
A.Parameter expansion — binding a name to a value with the equals sign, which must have no surrounding whitespace or the shell treats the name as a command
B.Parameter expansion — a quoting style that prevents word splitting and globbing while still allowing variable and dollar-substitution to occur inside
C.Parameter expansion — a quoting style that preserves every enclosed character literally, with no variable, history, or backslash interpretation at all
D.Parameter expansion — retrieving and optionally transforming a variable's value using brace syntax, supporting defaults, substring slicing, and pattern removal
Answer + AI explanation with Pro
10. What is Single quoting?
Junior
A.binding a name to a value with the equals sign, which must have no surrounding whitespace or the shell treats the name as a command
B.a quoting style that prevents word splitting and globbing while still allowing variable and dollar-substitution to occur inside
C.a construct that runs a command and replaces itself with that command's output, written with a dollar sign followed by parentheses
D.a quoting style that preserves every enclosed character literally, with no variable, history, or backslash interpretation at all
Answer + AI explanation with Pro
11. Which term means: "a quoting style that preserves every enclosed character literally, with no variable, history, or backslash interpretation at all"?
Junior
A.Single quoting
B.Variable assignment
C.Double quoting
D.Parameter expansion
Answer + AI explanation with Pro
12. Which statement is correct?
Junior
A.Single quoting — a quoting style that preserves every enclosed character literally, with no variable, history, or backslash interpretation at all
B.Single quoting — a construct that runs a command and replaces itself with that command's output, written with a dollar sign followed by parentheses
C.Single quoting — a brace form that yields a fallback string when a parameter is unset or empty, written with a colon-dash between name and fallback
D.Single quoting — retrieving and optionally transforming a variable's value using brace syntax, supporting defaults, substring slicing, and pattern removal
Answer + AI explanation with Pro
13. What is Double quoting?
Junior
A.a construct that runs a command and replaces itself with that command's output, written with a dollar sign followed by parentheses
B.binding a name to a value with the equals sign, which must have no surrounding whitespace or the shell treats the name as a command
C.a quoting style that prevents word splitting and globbing while still allowing variable and dollar-substitution to occur inside
D.a quoting style that preserves every enclosed character literally, with no variable, history, or backslash interpretation at all
Answer + AI explanation with Pro
14. Which term means: "a quoting style that prevents word splitting and globbing while still allowing variable and dollar-substitution to occur inside"?
Junior
A.Variable assignment
B.Parameter expansion
C.Command substitution
D.Double quoting
Answer + AI explanation with Pro
15. Which statement is correct?
Junior
A.Double quoting — a quoting style that prevents word splitting and globbing while still allowing variable and dollar-substitution to occur inside
B.Double quoting — retrieving and optionally transforming a variable's value using brace syntax, supporting defaults, substring slicing, and pattern removal
C.Double quoting — binding a name to a value with the equals sign, which must have no surrounding whitespace or the shell treats the name as a command
D.Double quoting — a construct that runs a command and replaces itself with that command's output, written with a dollar sign followed by parentheses
Answer + AI explanation with Pro
16. What is Default value expansion?
Mid
A.retrieving and optionally transforming a variable's value using brace syntax, supporting defaults, substring slicing, and pattern removal
B.a brace form that yields a fallback string when a parameter is unset or empty, written with a colon-dash between name and fallback
C.binding a name to a value with the equals sign, which must have no surrounding whitespace or the shell treats the name as a command
D.a quoting style that prevents word splitting and globbing while still allowing variable and dollar-substitution to occur inside
Answer + AI explanation with Pro
17. Which term means: "a brace form that yields a fallback string when a parameter is unset or empty, written with a colon-dash between name and fallback"?
Mid
A.Default value expansion
B.Double quoting
C.Command substitution
D.Parameter expansion
Answer + AI explanation with Pro
18. Which statement is correct?
Mid
A.Default value expansion — a quoting style that preserves every enclosed character literally, with no variable, history, or backslash interpretation at all
B.Default value expansion — a brace form that yields a fallback string when a parameter is unset or empty, written with a colon-dash between name and fallback
C.Default value expansion — a construct that runs a command and replaces itself with that command's output, written with a dollar sign followed by parentheses
D.Default value expansion — a quoting style that prevents word splitting and globbing while still allowing variable and dollar-substitution to occur inside
Answer + AI explanation with Pro
Free to start
Start with a free readiness check
Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Variables & Expansion question come with Pro.