Bash Scripting - Quoting and ExpansionWhich of the following correctly escapes a dollar sign ($) in a bash echo command?Aecho \100Becho $100Cecho \$100Decho $\100Check Answer
Step-by-Step SolutionSolution:Step 1: Identify how to escape $ in bashThe dollar sign is special for variables, so to print it literally, prefix with backslash: \$Step 2: Check each optionecho \$100 uses \$ correctly; B treats $100 as variable, C escapes wrong character, D mixes incorrectly.Final Answer:echo \$100 -> Option CQuick Check:Escape $ sign = A [OK]Quick Trick: Escape $ with backslash to print it literally [OK]Common Mistakes:MISTAKESNot escaping $ prints variable valueEscaping wrong characterMixing backslash and $ incorrectly
Master "Quoting and Expansion" in Bash Scripting9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Bash Scripting Quizzes Bash Scripting Basics - Making scripts executable (chmod +x) - Quiz 11easy Bash Scripting Basics - Why Bash scripting automates Linux tasks - Quiz 1easy Conditionals - File test operators (-f, -d, -e, -r, -w, -x) - Quiz 13medium Conditionals - if-then-else - Quiz 10hard Conditionals - test command and [ ] syntax - Quiz 1easy Loops - Infinite loops - Quiz 11easy Loops - for loop (list-based) - Quiz 15hard Variables - Why variables store and reuse data - Quiz 7medium Variables - Accessing variables ($var and ${var}) - Quiz 12easy Variables - Variable assignment (no spaces around =) - Quiz 8hard