Bird
0
0

Why does the read -s command not display input characters, and what happens internally when you use it?

hard🧠 Conceptual Q10 of 15
Bash Scripting - User Input
Why does the read -s command not display input characters, and what happens internally when you use it?
AIt redirects input to /dev/null
BIt encrypts input before storing in variable
CIt clears the screen before input
DIt disables terminal echo, so characters typed are not shown but still captured
Step-by-Step Solution
Solution:
  1. Step 1: Understand terminal echo behavior

    Normally, terminal shows characters typed (echo enabled).
  2. Step 2: Effect of -s option

    -s disables echo temporarily, so input is hidden but still read and stored.
  3. Final Answer:

    It disables terminal echo, so characters typed are not shown but still captured -> Option D
  4. Quick Check:

    read -s disables echo, input captured silently [OK]
Quick Trick: read -s disables echo, hides input but stores it [OK]
Common Mistakes:
MISTAKES
  • Thinking input is encrypted automatically
  • Assuming screen is cleared
  • Believing input is discarded

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes