Grep acts differently depending on what kind of quotes I surround the regex with. I can\'t seem to get a clear understanding of why this is. Here is an example of the problem:>
The command line including the arguments is processed by the shell before it is executed. You can use echo to see what the shell does:
$ echo grep -e show\( test.txt
grep -e show( test.txt
$ echo grep -e "show\(" test.txt
grep -e show\( test.txt
$ echo grep -e 'show\(' test.txt
grep -e show\( test.txt
So without quotes the backslash gets removed making the "(" a normal character for grep (grep uses basic regex by default, use -E to make grep use extended regex).