On Tue, Jul 5, 2011 at 3:56 AM, dexen deVries <dexen.devr...@gmail.com> wrote:
> on plan9port:
> % echo foobar | 9 grep '$JUNK'
>  -> foobar
>
> that is, p9p grep matches any line with regular expression in form of
> $ANY_REGEX
>
> why is it so?

It's an ancient bug in the Plan 9 grep, a complication
of the way Ken implemented ^ and $: as aliases for \n (!).
It looks like someone added a workaround for this one
case in the Plan 9 sources since I forked them for
plan9port seven years ago.  I pulled it in.

For fun, try seeing what matches '^$^$' across a
variety of grep implementations.

Russ

Reply via email to