Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Grep Help
On 04/12/2006 03:56:57 PM, Ethan Post wrote:
> > cat f
>
> $Log: Blah
>
> > grep "\$Log: .*\$" f
>
> $Log: Blah
>
> I am actually looking for a line which has Dollar Log Colon ...any
> characters...dollar...any characters...but this still returns the line, even
> thought it is missing the last dollar. I am sure this is a pretty obvious
> one, please help.
To help you out, you'd first have to tell me what do you want grep to return? That is the definition of grep: it returns lines of the file containing the regular expression you specify:
GREP(1) GREP(1) NAME grep, egrep, fgrep - print lines matching a pattern SYNOPSIS grep [options] PATTERN [FILE...] grep [options] [-e PATTERN | -f FILE] [FILE...] DESCRIPTION Grep searches the named input FILEs (or standard input if no files are named, or the file name - is given) for lines containing a match to the given PATTERN. By default, grep prints the matching lines. In addition, two variant programs egrep and fgrep are available. Egrep is the same as grep -E. Fgrep is the same as grep -F. OPTIONS -A NUM, --after-context=NUM Print NUM lines of trailing context after matching lines. Places a line containing -- between contiguous groups of
Pay attention to the phrase "grep prints matching lines". Reading the fine manual is sometimes a good idea. Now, that this is out of the way, please explain what you need and thy will shalt be done. There are other utilities, like the pathologically eclectic rubbish lister, which can help you with decomposition of the affected lines.
-- Mladen Gogala http://www.mgogala.com -- http://www.freelists.org/webpage/oracle-lReceived on Wed Apr 12 2006 - 22:59:38 CDT