Bird
0
0

Which of the following is the correct syntax to read three variables name, age, and city from user input in bash?

easy📝 Syntax Q12 of 15
Bash Scripting - User Input
Which of the following is the correct syntax to read three variables name, age, and city from user input in bash?
Aread name age city
Bread name, age, city
Cread(name age city)
Dread -v name age city
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct read syntax

    The read command uses space-separated variable names without commas or parentheses.
  2. Step 2: Identify correct option

    read name age city uses read name age city, which is the proper syntax to read into three variables.
  3. Final Answer:

    read name age city -> Option A
  4. Quick Check:

    Variables separated by spaces in read [OK]
Quick Trick: Use spaces, no commas or parentheses in read [OK]
Common Mistakes:
MISTAKES
  • Adding commas between variable names
  • Using parentheses like a function call
  • Using unsupported flags like -v

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes