[Toybox] grep and empty regexes

enh enh at google.com
Mon Jul 29 12:03:07 PDT 2019


On Mon, Jul 29, 2019 at 7:55 AM Ed Maste <emaste at freebsd.org> wrote:
>
> On Mon, 29 Jul 2019 at 07:19, Rob Landley <rob at landley.net> wrote:
> >
> > Your timing is impeccable. Guess what the gmail spurious delivery failure due to
> > spam false positive du jour was? (Other than me. I get unsubscribed to my own
> > list and have to send a "confirm" email twice a week. Yes, I need to move off
> > gmail, but I'm kinda busy...)
>
> You and me both :(
>
> One caveat, on FreeBSD by default we still have:
>
> % grep --version
> grep (GNU grep) 2.5.1-FreeBSD

interesting. when i say "BSD grep" i either mean NetBSD (if i'm
talking about Android), or whatever it is that Apple ships (if i'm
talking about macOS). i've never actually _used_ NetBSD, so i don't
know if they use their grep or default to the GNU one. macOS, though,
definitely doesn't use the GNU one. i don't think they use the NetBSD
one either. theirs is the worst grep i've used since the early 1990s
at least. (just the -r behavior is enough to make me never want to use
it, and they "fixed" that by printing out a message telling you
they're doing the wrong thing but continuing to do it anyway. i of all
people have a lot of sympathy for having to maintain backwards
compatibility, but "grep -r doesn't work" seems like behavior i'd want
to make folks opt in to in 2019.)

> Replacing it with BSD grep is in progress, and it's still under
> somewhat active development. There's also a WITH_GNU_GREP_COMPAT
> build-time option that links against libgnuregex. So there are lots of
> ways the BSD libc regcomp won't be used in whatever is installed as
> /usr/bin/grep.



More information about the Toybox mailing list