Bird
0
0

What happens if you use the read command without specifying a variable name?

easy🧠 Conceptual Q1 of 15
Bash Scripting - User Input
What happens if you use the read command without specifying a variable name?
AIt causes a syntax error and stops the script.
BIt reads input and stores it in the default variable <code>REPLY</code>.
CIt reads input but discards it immediately.
DIt waits for input but does not store it anywhere.
Step-by-Step Solution
Solution:
  1. Step 1: Understand default behavior of read

    When no variable is given, read stores input in REPLY.
  2. Step 2: Confirm no error occurs

    Since read defaults to REPLY, no syntax error happens.
  3. Final Answer:

    It reads input and stores it in the default variable REPLY. -> Option B
  4. Quick Check:

    Default variable = REPLY [OK]
Quick Trick: No variable? Input goes to REPLY by default [OK]
Common Mistakes:
MISTAKES
  • Assuming read without variable causes error
  • Thinking input is discarded
  • Believing input is stored in a random variable

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes