Hello!

>    $ grep -vE '^ *+' infile
>    $ 
> 
> That behavior is correct for GNU grep, but it is an extension to POSIX.2.
> POSIX.2 does not specify the behavior for + after * in an extended
> regular expression (i.e. the type of regular expression used by grep
> -E).  So a portable script should never do this.

... and a good implementation of egrep shouldn't get crazy because of
that. My $0.02

>    2) Can it be rewritten is a more portable form?
> 
> It should be portable as-is.  I've never seen a grep where it didn't
> work.

Anybody?

> I suspect that the problem lies elsewhere.

Exactly. The real explanation lies somewhere in config.log of the guy who
reported the problem.

>    `+' isn't a portable literal.  Some implementations seem to use it as
>    a meta-character with the usual meaning, but without support for it
>    after `*'.

Alexandre, could you be more exact? We probably need a short comment in
acgeneral.m4 about _that_ implementation to discourage people from
replacing grep with egrep.

Regards,
Pavel Roskin

Reply via email to