Quote Originally Posted by jcdenton1995 View Post
I thought that wrapping a string in quotes was sufficient to protect the meta-characters in it from being expanded by the shell? why is the '$' necessary? (or does the '$' ensure that '\n' is expanded by the shell??)
Exactly that. "man bash" is really hard to read unless you know what you are looking for. Try "man bash" and search for QUOTING (yes, capitals). There is this sentence:
Words of the form $'string' are treated specially. The word expands to string, with backslash-escaped characters replaced as specified by the ANSI C standard.