Bird
0
0

Identify the error in the command:

medium📝 Debug Q6 of 15
Bash Scripting - Quoting and Expansion
Identify the error in the command:
echo {1..5..}
AOutputs numbers 1 to 5 correctly
BOutputs literal string {1..5..}
CSyntax error due to incomplete step value
DOutputs numbers 1, 5 only
Step-by-Step Solution
Solution:
  1. Step 1: Analyze brace expansion with step

    Brace expansion can have a step like {start..end..step}. Here step is missing after two dots.
  2. Step 2: Identify the behavior

    Due to incomplete step syntax, Bash outputs the literal string {1..5..}.
  3. Final Answer:

    Outputs literal string {1..5..} -> Option B
  4. Quick Check:

    Incomplete brace syntax = literal output [OK]
Quick Trick: Step value must be a number after two dots [OK]
Common Mistakes:
MISTAKES
  • Leaving step value empty
  • Assuming missing step defaults to 1
  • Expecting literal output instead of error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes