What I\'d like to do is take, as an input to a function, a line that may include quotes (single or double) and echo that line exactly as it was provided to the function. For
The shell is going to interpret the quotes and the $
before it passes it to your function. There's not a lot your function can do to get the special characters back, because it has no way of knowing (in the double-quote example) whether 42
was hard-coded or if it came from a variable. You will have to escape the special characters if you want them to survive long enough to make it to your function.