Bird
0
0

What does the -s option do when used with the read command in bash scripting?

easy🧠 Conceptual Q11 of 15
Bash Scripting - User Input
What does the -s option do when used with the read command in bash scripting?
AIt hides the user input on the terminal (silent input).
BIt shows the input characters in uppercase.
CIt saves the input to a file automatically.
DIt pauses the script until a key is pressed.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of read -s

    The -s option in read hides the input typed by the user, making it silent on the terminal.
  2. Step 2: Compare with other options

    Other options do not hide input; -s is specifically for silent input, useful for passwords.
  3. Final Answer:

    It hides the user input on the terminal (silent input). -> Option A
  4. Quick Check:

    read -s = silent input [OK]
Quick Trick: Remember: -s means silent input, no characters shown [OK]
Common Mistakes:
MISTAKES
  • Thinking -s shows input in uppercase
  • Confusing -s with saving input to file
  • Assuming -s pauses the script

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes