Bird
0
0

What is the output of this bash command?

medium📝 Command Output Q4 of 15
Bash Scripting - Quoting and Expansion
What is the output of this bash command?
echo This\ is\ a\ test
AThis is a\ test
BThis\ is\ a\ test
CThis is a test\
DThis is a test
Step-by-Step Solution
Solution:
  1. Step 1: Understand backslash escaping spaces

    Backslash before space escapes it, so spaces are preserved literally.
  2. Step 2: Interpret the command output

    All backslashes remove special meaning of spaces, so output is 'This is a test' with spaces.
  3. Final Answer:

    This is a test -> Option D
  4. Quick Check:

    Backslash escapes spaces = C [OK]
Quick Trick: Backslash before space keeps space literal [OK]
Common Mistakes:
MISTAKES
  • Printing backslash literally
  • Missing spaces
  • Confusing escaped spaces with escaped letters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes