The reason is that you were using a double quoted string. Variables and Escape chars are interpolated into double quoted strings. Not so, with single quoted strings....
Lincoln On Mon, 2003-02-10 at 00:13, Mike Williams wrote: > On Mon, 2003-02-10 at 05:09, Cedric Veilleux wrote: > > Hi, > > > > What is the correct regular expression for a simple $ character? I want to > > filter a file for any lines containing a $ char, but it does not work.. > > > > man grep tells me $ is a special regular expression char.. I try to escape it > > using \$ but it doesn't work.. > > Oddly a double backslash (\\) escape works, with or without quotes, but > don't ask me why! > > grep "\\$" afile -- Lincoln A. Baxter <[EMAIL PROTECTED]> -- [EMAIL PROTECTED] mailing list