[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bugs about grep

From: Stepan Kasal
Subject: Re: bugs about grep
Date: Thu, 8 Jul 2004 15:48:11 +0200
User-agent: Mutt/1.4.1i


On Thu, Jul 08, 2004 at 01:06:19PM +0000, Hans-Bernhard Broeker wrote:
> ?? <address@hidden> wrote:
> > #cat abc | grep -Fw
> >         ----no result .
> It may not be totally clear from the documentation, but with a bit of
> thinking it can be seen that -F and -w quite certainly can't work
> together.  -w applies to regexps, [...]

I beleive that they should work together, and that the bug report is really
valid.  And as I'm the maintainer, this opinion has a certain value.  ;-)

The long name of the option `--word-regexp' is not good, I admit.

The bug will eventually be squashed.

For the meantime, the qorkaround you propose is good:

>       grep -w '10\.1\.3\.3' < abc

One more comment:

> whereas -F says that [...] the program effectively isn't "grep",
> then --- it's "fgrep".

this wording is a bit misleading.  fgrep and egrep are not standardized by
POSIX, they are provided for compatibility with traditional Unices only.

Current grep release implements fgrep and egrep as a shell wrappers:
$ cat /bin/fgrep
exec grep -F ${1+"$@"}

Thus you should get slowly accustomed to using `grep -F', not `fgrep'.
(The shell wrapper can even present a performance problem if fgrep is
called too often.)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]