Special Variables interview questions

18 real Special Variables questions from the Bash bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is Exit code variable?

Junior
  1. A.the special parameter holding the numeric result of the most recently completed foreground command, read as dollar-question-mark
  2. B.the special parameter that expands to the name the current script or shell was invoked under, read as dollar-zero
  3. C.the special parameter that expands to how many positional arguments were supplied, read as dollar-hash
  4. D.the parameter that, when double quoted, fuses every positional argument into one word joined by the first field-separator character, written as dollar-star
Reveal the answer + AI explanation — free account

2. Which term means: "the special parameter holding the numeric result of the most recently completed foreground command, read as dollar-question-mark"?

Junior
  1. A.Background PID variable
  2. B.Exit code variable
  3. C.Argument count variable
  4. D.Quoted all-arguments array
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.Exit code variable — the special parameter holding the numeric result of the most recently completed foreground command, read as dollar-question-mark
  2. B.Exit code variable — the special parameter that expands to how many positional arguments were supplied, read as dollar-hash
  3. C.Exit code variable — the special parameter that expands to the name the current script or shell was invoked under, read as dollar-zero
  4. D.Exit code variable — the special parameter holding the process id of the most recently started asynchronous command, read as dollar-bang
Reveal the answer + AI explanation — free account

4. What is Script name variable?

Junior
  1. A.the parameter that, when double quoted, expands to each positional argument as its own separate word, written as dollar-at
  2. B.the special parameter holding the numeric result of the most recently completed foreground command, read as dollar-question-mark
  3. C.the special parameter holding the process id of the most recently started asynchronous command, read as dollar-bang
  4. D.the special parameter that expands to the name the current script or shell was invoked under, read as dollar-zero
Reveal the answer + AI explanation — free account

5. Which term means: "the special parameter that expands to the name the current script or shell was invoked under, read as dollar-zero"?

Junior
  1. A.Script name variable
  2. B.Quoted all-arguments array
  3. C.Exit code variable
  4. D.Joined all-arguments string
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Junior
  1. A.Script name variable — the special parameter holding the numeric result of the most recently completed foreground command, read as dollar-question-mark
  2. B.Script name variable — the parameter that, when double quoted, expands to each positional argument as its own separate word, written as dollar-at
  3. C.Script name variable — the parameter that, when double quoted, fuses every positional argument into one word joined by the first field-separator character, written as dollar-star
  4. D.Script name variable — the special parameter that expands to the name the current script or shell was invoked under, read as dollar-zero
Reveal the answer + AI explanation — free account

7. What is Argument count variable?

Mid
  1. A.the parameter that, when double quoted, fuses every positional argument into one word joined by the first field-separator character, written as dollar-star
  2. B.the special parameter that expands to how many positional arguments were supplied, read as dollar-hash
  3. C.the special parameter holding the process id of the most recently started asynchronous command, read as dollar-bang
  4. D.the special parameter that expands to the name the current script or shell was invoked under, read as dollar-zero
Reveal the answer + AI explanation — free account

8. Which term means: "the special parameter that expands to how many positional arguments were supplied, read as dollar-hash"?

Mid
  1. A.Quoted all-arguments array
  2. B.Joined all-arguments string
  3. C.Background PID variable
  4. D.Argument count variable
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Mid
  1. A.Argument count variable — the special parameter that expands to how many positional arguments were supplied, read as dollar-hash
  2. B.Argument count variable — the parameter that, when double quoted, expands to each positional argument as its own separate word, written as dollar-at
  3. C.Argument count variable — the parameter that, when double quoted, fuses every positional argument into one word joined by the first field-separator character, written as dollar-star
  4. D.Argument count variable — the special parameter holding the process id of the most recently started asynchronous command, read as dollar-bang
Reveal the answer + AI explanation — free account

10. What is Quoted all-arguments array?

Mid
  1. A.the special parameter that expands to the name the current script or shell was invoked under, read as dollar-zero
  2. B.the parameter that, when double quoted, fuses every positional argument into one word joined by the first field-separator character, written as dollar-star
  3. C.the parameter that, when double quoted, expands to each positional argument as its own separate word, written as dollar-at
  4. D.the special parameter holding the process id of the most recently started asynchronous command, read as dollar-bang
Reveal the answer + AI explanation — free account

11. Which term means: "the parameter that, when double quoted, expands to each positional argument as its own separate word, written as dollar-at"?

Mid
  1. A.Exit code variable
  2. B.Argument count variable
  3. C.Joined all-arguments string
  4. D.Quoted all-arguments array
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.Quoted all-arguments array — the parameter that, when double quoted, expands to each positional argument as its own separate word, written as dollar-at
  2. B.Quoted all-arguments array — the special parameter that expands to the name the current script or shell was invoked under, read as dollar-zero
  3. C.Quoted all-arguments array — the parameter that, when double quoted, fuses every positional argument into one word joined by the first field-separator character, written as dollar-star
  4. D.Quoted all-arguments array — the special parameter holding the numeric result of the most recently completed foreground command, read as dollar-question-mark
Reveal the answer + AI explanation — free account

13. What is Joined all-arguments string?

Senior
  1. A.the parameter that, when double quoted, fuses every positional argument into one word joined by the first field-separator character, written as dollar-star
  2. B.the special parameter that expands to how many positional arguments were supplied, read as dollar-hash
  3. C.the parameter that, when double quoted, expands to each positional argument as its own separate word, written as dollar-at
  4. D.the special parameter holding the process id of the most recently started asynchronous command, read as dollar-bang
Reveal the answer + AI explanation — free account

14. Which term means: "the parameter that, when double quoted, fuses every positional argument into one word joined by the first field-separator character, written as dollar-star"?

Senior
  1. A.Exit code variable
  2. B.Background PID variable
  3. C.Script name variable
  4. D.Joined all-arguments string
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Senior
  1. A.Joined all-arguments string — the special parameter that expands to how many positional arguments were supplied, read as dollar-hash
  2. B.Joined all-arguments string — the parameter that, when double quoted, fuses every positional argument into one word joined by the first field-separator character, written as dollar-star
  3. C.Joined all-arguments string — the special parameter holding the numeric result of the most recently completed foreground command, read as dollar-question-mark
  4. D.Joined all-arguments string — the special parameter that expands to the name the current script or shell was invoked under, read as dollar-zero
Reveal the answer + AI explanation — free account

16. What is Background PID variable?

Mid
  1. A.the special parameter holding the process id of the most recently started asynchronous command, read as dollar-bang
  2. B.the parameter that, when double quoted, fuses every positional argument into one word joined by the first field-separator character, written as dollar-star
  3. C.the special parameter holding the numeric result of the most recently completed foreground command, read as dollar-question-mark
  4. D.the special parameter that expands to the name the current script or shell was invoked under, read as dollar-zero
Reveal the answer + AI explanation — free account

17. Which term means: "the special parameter holding the process id of the most recently started asynchronous command, read as dollar-bang"?

Mid
  1. A.Argument count variable
  2. B.Background PID variable
  3. C.Exit code variable
  4. D.Script name variable
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Mid
  1. A.Background PID variable — the special parameter holding the numeric result of the most recently completed foreground command, read as dollar-question-mark
  2. B.Background PID variable — the special parameter that expands to how many positional arguments were supplied, read as dollar-hash
  3. C.Background PID variable — the special parameter holding the process id of the most recently started asynchronous command, read as dollar-bang
  4. D.Background PID variable — the parameter that, when double quoted, expands to each positional argument as its own separate word, written as dollar-at
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Special Variables free