Bird
0
0

You want to create a bash script that prints the path C:\Users\Admin literally. Which command correctly escapes the backslashes?

hard🚀 Application Q8 of 15
Bash Scripting - Quoting and Expansion
You want to create a bash script that prints the path C:\Users\Admin literally. Which command correctly escapes the backslashes?
Aecho C:\Users\Admin
Becho C:\\Users\\Admin
Cecho C:\Users\\Admin
Decho C:\\Users\Admin
Step-by-Step Solution
Solution:
  1. Step 1: Understand escaping backslash in bash

    Backslash is escape character, so to print one backslash, use two backslashes \\.
  2. Step 2: Check each option for correct double backslashes

    echo C:\\Users\\Admin doubles all backslashes correctly; others miss some escapes causing errors or wrong output.
  3. Final Answer:

    echo C:\\Users\\Admin -> Option B
  4. Quick Check:

    Double backslash to print one backslash = B [OK]
Quick Trick: Double backslash prints one backslash [OK]
Common Mistakes:
MISTAKES
  • Single backslash prints escape
  • Inconsistent escaping
  • Missing backslash escapes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes