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
- Re: grep -E ? (Was: Compilation pro... Paul Eggert
- Re: grep -E ? (Was: Compilation pro... Thomas Dickey
- Re: grep -E ? (Was: Compilation pro... Paul Eggert
- Re: grep -E ? (Was: Compilation problem ... Paul Eggert
- Re: grep -E ? (Was: Compilation problem solved) Pavel Roskin
- Re: grep -E ? (Was: Compilation problem solved) Alexandre Oliva
- Re: grep -E ? (Was: Compilation problem solved) Pavel Roskin
- Re: grep -E ? (Was: Compilation problem solv... Alexandre Oliva
- Re: grep -E ? (Was: Compilation problem ... Pavel Roskin
- Re: grep -E ? (Was: Compilation problem solved) Paul Eggert
- Re: grep -E ? (Was: Compilation problem solved) Pavel Roskin
- Re: grep -E ? (Was: Compilation problem solv... Alexandre Oliva
- Re: grep -E ? (Was: Compilation problem ... Pavel Roskin
- Re: grep -E ? (Was: Compilation pro... Paul Eggert
- Re: grep -E ? (Was: Compilation pro... Pavel Roskin
- Re: grep -E ? (Was: Compilation pro... Thomas Dickey
- Re: grep -E ? (Was: Compilation pro... Pavel Roskin
- Re: grep -E ? (Was: Compilation pro... Thomas E. Dickey
- Re: grep -E ? (Was: Compilation pro... Thomas Dickey
- Re: grep -E ? (Was: Compilation pro... Paul Eggert
- Re: grep -E ? (Was: Compilation pro... Thomas Dickey