Bird
0
0

Which of the following is the correct syntax to read a single line of input into a variable named input?

easy📝 Syntax Q3 of 15
Bash Scripting - User Input
Which of the following is the correct syntax to read a single line of input into a variable named input?
Areadline input
Bread -line input
Creadline -v input
Dread input
Step-by-Step Solution
Solution:
  1. Step 1: Recall basic read syntax

    The command read input reads one line into variable input.
  2. Step 2: Verify other options

    Options A, B, and D are invalid commands or flags in bash.
  3. Final Answer:

    read input -> Option D
  4. Quick Check:

    Basic read syntax = read variable [OK]
Quick Trick: Simple read: read variable_name [OK]
Common Mistakes:
MISTAKES
  • Using non-existent flags like -line
  • Confusing read with readline command
  • Adding extra parameters unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes