0

I'm trying to understand if bash is doing something with the string before passing it to grep or if grep uses basic regex searching by default. The man page and other answers don't really clarify

ss -an | grep "8.02"

u_dgr            UNCONN                 0                   0                                                                                                 * 820284002                                            * 820284001                
u_str            ESTAB                  0                   0                                                                                                 * 820283949                                            * 820287456                

It looks like the . is being used in a regex fashion to match a single char. However, I would only expect this to happen when using grep -e or grep -E. If bash was intercepting the string I would expect special shell chars to be intercepted first such as * or ?.

The man entry states I am using GNU grep 3.1

oguz ismail
  • 1
  • 16
  • 47
  • 69
myol
  • 8,857
  • 19
  • 82
  • 143

1 Answers1

1

Looks like I have immediately found the answer after RTFMing a little closer

-G, --basic-regexp Interpret PATTERN as a basic regular expression (BRE, see below). This is the default.

"This is the default" - I assume means this is the default behaviour if no flags are passed?

myol
  • 8,857
  • 19
  • 82
  • 143