<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Do grep \. testfile<br>
<br>
and it will match every char in the file. The '.' isn't escaped by the<br>
'\'. <br></blockquote><div><br></div><div>Wouldn't that be because it's escaping the '.' for the shell but not grep?</div><div><br></div><div>So 'grep \\. /etc/passwd' will output only the lines that contain a '.'</div>
<div><br></div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
Using [.] does indeed treat it as a literal. </blockquote><div><br></div><div>Yes, '.' inside square brackets isn't a wildcard.</div><div> </div><div>To keep it simple, why not surround your entire regex with single-quotes.</div>
<div><br></div></div>