On Thu, Jun 14, 2012 at 4:00 PM,  <tlaro...@polynum.com> wrote:
> On Thu, Jun 14, 2012 at 09:44:25AM -0400, erik quanstrom wrote:
>> > > nope, that's not right.  * starting a pattern escapes the whole string.
>> > > this is unique to grep.
>
> I guess this is surprising because with a POSIX grep(1), if I read the
> description correctly:
>
> 1) If the * is the very character of a BRE (since POSIX has BRE and ERE)
> it shall be treated as is---but the remaining of the expression is
> interpreted.
>
> 2) In a ERE, if the * is the very first character, or follows |,
> ^ or ( this is undefined.

Also this:

cpu%  echo hola | grep '*'
grep: *: syntax error
cpu%  echo hola | grep ''
grep: empty pattern


grep '*' and grep '' should still be the same, shouldn't they?

G.

Reply via email to