Bird
0
0

Identify the error in this command:

medium📝 Debug Q6 of 15
Linux CLI - Text Processing
Identify the error in this command:
echo "abc" | tr 'a-z' 'A-Z' '0-9'
ANo error, command works fine
BExtra argument '0-9' causes syntax error
CTarget set is missing
DSource set is invalid
Step-by-Step Solution
Solution:
  1. Step 1: Check the number of arguments to tr

    tr expects exactly two sets: source and target. Here, three arguments are given.
  2. Step 2: Identify the cause of error

    The extra '0-9' argument is invalid and causes a syntax error.
  3. Final Answer:

    Extra argument '0-9' causes syntax error -> Option B
  4. Quick Check:

    Extra argument error = Extra argument '0-9' causes syntax error [OK]
Quick Trick: tr needs exactly two sets, no extras [OK]
Common Mistakes:
  • Adding extra sets
  • Swapping source and target
  • Missing quotes around sets

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes