Bird
0
0

Why does the command

hard🧠 Conceptual Q10 of 15
Bash Scripting - Quoting and Expansion
Why does the command
echo "Path: C:\Users\Admin"
print
Path: C:\Users\Admin
correctly in bash?
ABecause backslash escapes the following character inside double quotes
BBecause backslash is ignored inside double quotes
CBecause echo automatically adds backslashes
DBecause single quotes are used inside double quotes
Step-by-Step Solution
Solution:
  1. Step 1: Understand backslash behavior inside double quotes

    Inside double quotes, backslash escapes special characters like backslash itself, so \\ prints one backslash.
  2. Step 2: Analyze why output is correct

    Backslash before U and A escapes them literally, so output shows single backslashes as expected.
  3. Final Answer:

    Because backslash escapes the following character inside double quotes -> Option A
  4. Quick Check:

    Backslash escapes chars inside double quotes = D [OK]
Quick Trick: Backslash escapes characters inside double quotes [OK]
Common Mistakes:
MISTAKES
  • Thinking backslash is ignored
  • Assuming echo adds backslashes
  • Confusing quote types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes