Bird
0
0

What does the read command do in a bash script?

easy🧠 Conceptual Q11 of 15
Bash Scripting - User Input
What does the read command do in a bash script?
AIt runs another script.
BIt prints text to the screen.
CIt waits for user input and stores it in a variable.
DIt deletes files.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of read

    The read command pauses the script and waits for the user to type something.
  2. Step 2: Identify what happens with the input

    The input typed by the user is saved into a variable for later use in the script.
  3. Final Answer:

    It waits for user input and stores it in a variable. -> Option C
  4. Quick Check:

    read = wait for input and save [OK]
Quick Trick: Remember: read = get input from user [OK]
Common Mistakes:
MISTAKES
  • Thinking read prints output
  • Confusing read with echo
  • Assuming read runs commands

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes