On Wed, Jul 12, 2006 at 12:23:44PM +0300, Ehud Karni wrote: > > Last time I checked, "$" in regexp meant "match end of line". '$Id' > > would mean, if I understand this correctly, an "Id" coming AFTER the end > > of the line (an impossible combination, I know, but still). If I want > > grep to understand a literal "$", I need to pass it a "\$", which I can > > do either by doing "\\\$Id" or '\$Id'. > > > > I stand by my original statement. > > You are right. > > I'll say it again: YOU ARE RIGHT ! I take my statement back.
Not quite. There are basic regular expressions and extended regular expressions. The "$" means end of string only when used as an "anchor". In basic regular expressions, the "$" is an anchor only if used at the end of the regular expression. For extended regular expression, what Shachar said is essentially correct. Apparently, diff uses basic regular expressions. bash-3.00$ cat t1 "$Id: clone.cc,v 1.27 2006/07/10 08:30:21 olegg Exp $"; bash-3.00$ grep '$Id' t1 "$Id: clone.cc,v 1.27 2006/07/10 08:30:21 olegg Exp $"; bash-3.00$ grep -E '$Id' t1 bash-3.00$ ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
