echo "Here's \$7.80" |
grep -oE [$][0-9]+.[0-9]+
gives me my desired $7.80
But:
1. I had to escape the $7, so why:
a. CAN'T I escape the . in $7.80
b. IS IT OPTIONAL to escape the . in my
regular expression?
echo "this.that" | grep -o \. will not match the .
Why do I need to escape the backslash? I thought whenever you had a character you wanted to match literally you just needed to precede it with a backslash. The proper regex, which is \\. looks like I'm looking for a backslash followed by any single character
echo "this.that" | grep -o '.' interprets the special meaning of '.' If that's the case, why won't
echo "this.that" | grep -o '\\.' match exactly a dot?
Besides interpolating variables, is there a difference between using single quotes and double quotes? In Unix? In Kornshell?
Thanks.