From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <20120614140047.GA1725@polynum.com> References: <84c3d5dd7667b66697f94c5e142bf831@coraid.com> <301f8dfa8383d61d620e4412292986f8@kw.quanstro.net> <20120614140047.GA1725@polynum.com> Date: Thu, 14 Jun 2012 16:13:12 +0200 Message-ID: From: Gorka Guardiola To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] empty * Topicbox-Message-UUID: 9e83aca6-ead7-11e9-9d60-3106f5b1d025 On Thu, Jun 14, 2012 at 4:00 PM, wrote: > On Thu, Jun 14, 2012 at 09:44:25AM -0400, erik quanstrom wrote: >> > > nope, that's not right. =A0* starting a pattern escapes the whole st= ring. >> > > 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.