Bird
0
0

Why does this command fail?

medium📝 Debug Q7 of 15
Bash Scripting - Text Processing in Scripts
Why does this command fail?
echo "abc" | tr 'a-z'
Atr does not accept piped input
BInput string is empty
CMissing second set of characters for translation
DQuotes are incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Check tr syntax requirements

    tr requires two sets of characters for translation: source and target.
  2. Step 2: Analyze the command

    Only one set 'a-z' is provided, so the command fails due to missing second set.
  3. Final Answer:

    Missing second set of characters for translation -> Option C
  4. Quick Check:

    tr needs two sets = missing second set causes failure [OK]
Quick Trick: Always provide two sets for translation in tr [OK]
Common Mistakes:
MISTAKES
  • Providing only one set
  • Thinking tr rejects piped input
  • Incorrect quotes causing failure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes