Quoting is a bit of a dark art ... but persist and you will quickly become the expert ...
"double quotes" allow certain things within the quoted string to be be expanded. The best example is shell variables, so for example if you do something like this:
echo "Hello $NAME"
'Single quotes' however, cause (almost) everything to be passed through unchanged. Thus:
echo 'Hello $NAME'
Now, to answer your question ... The ! character is used by the shell to reference back to previously executed commands. If you type
into the shell, you'll see a numbered list of commands that you have previously entered. If you type at the command prompt:
It will rerun command number 123 from your history. Similarly, if you type
It will rerun the most-recently-entered command that starts with the string foo.
When you use '!' in single quotes, it's special meaning is lost, it just goes through unchanged. Similarly the \ before it: that is passed unchanged, so
Now if you use "double quotes" in the same example, it does this (because the \ hides the ! from the shell, conceptually):
But here's the punchline (note, there is no \backslash here):
fails because the shell cannot find an event in your history to match the !
So, in summary: Bob added a backslash to remove the meaning of the ! He would perhaps have done better to use single quotes (and no backslash).
But that could have caused problems in his script, because in certain cases the shell will *reinterpret* values. The best/safest bet (imho) is to wrap every reference to a variable in "double quotes", thus from Bob's script:
sh script_tutorial 'Hello, World!'
This should Just Work
I hope this helps.