I am confused about the backslash character \ and single quotations inside grep. From my understanding it preserves the literal meaning. For example
if I do
echo 'This is \., it gives me
This is \.
However, if I want to match any actual .(period) I need to use '\.' to escape the special meaning of . in regular expression. For example if a have a file demo.txt taken from example from this website
My question is how is the ' ' not preserving the literal value in this case for grep? This is proving to be very confusing for me. Any explanations would be very helpful.