Well, GNU grep was last released 16 months ago, and the last change to its master branch was 4 weeks ago: http://git.savannah.gnu.org/cgit/grep.git
FreeBSD's grep was last updated back in August: https://github.com/freebsd/freebsd/tree/master/usr.bin/grep
OpenBSD's grep was last updated 11 months ago: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/grep/
Oddly, it looks like the Darwin grep was last updated in 2012: https://opensource.apple.com/source/text_cmds/text_cmds-99/g...
Strange that Apple would be shipping such an ancient grep.
I don't think it is that strange. Command line tools such as grep don't appear to be a development priority for Apple. Their focus appears to be on features visible to the average user, who uses the GUI instead of the command line.
Command line tools are mainly used by developers and power users, and the existing tools are generally good enough for most purposes, and people who want something better can always install the GNU versions using Homebrew/MacPorts/etc. There isn't much market demand for improvements in this area, so it makes sense Apple wouldn't invest in it.
Maybe they ceded this part of the OS to Homebrew? I know I never try to update anything stock in the OS. It's so much easier/faster to `brew install xxxxxx` than mess with the OS which might get overwritten with an official update anyway.
$ uname -v
Darwin Kernel Version 13.4.0: Mon Jan 11 18:17:34 PST 2016; root:xnu-2422.115.15~1/RELEASE_X86_64
$ grep --version
grep (BSD grep) 2.5.1-FreeBSD
I don't have historical information, but that's at least consistent. $ uname -v
Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386
$ grep --version
grep (GNU grep) 2.5.1
Other man pages: ed says 1993, sed says BSD 2004, cat says 3rd Berkeley Distribution 1995.I found a comment claiming that prior to 10.8 (2012, Mountain Lion) it used GNU grep, but nothing I'd feel comfortable citing.
$ type grep
grep is hashed (/usr/bin/grep)
It does seem to be the original grep for this machine (it's a Mac Mini) - it has the same Jan 2006 date as most of the files in /usr/bin, and nothing has an earlier date. There's no other file called grep elsewhere.Neither of these statements are true. grep on FreeBSD is still GNU grep, and it has a distinct version text from bsdgrep:
$ grep -V
grep (GNU grep) 2.5.1-FreeBSD
Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ bsdgrep -V
bsdgrep (BSD grep) 2.6.0-FreeBSD
$ uname -rK
13.0-CURRENT 1300003MacOS:
* https://unix.stackexchange.com/questions/352977/
* https://unix.stackexchange.com/a/398249/5132
The very version of FreeBSD from some years ago:
% bsdgrep --version
bsdgrep (BSD grep) 2.5.1-FreeBSD
% grep --version
grep (GNU grep) 2.5.1-FreeBSD
Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%
More on that:* https://unix.stackexchange.com/a/65609/5132
Kyle Evans and others on making bsdgrep into grep:
strcmp("bsdgrep (BSD grep) 2.5.1-FreeBSD", "grep (GNU grep) 2.5.1-FreeBSD") != 0
Also, I'm personally in contact with Kyle Evans and am familiar with the general interest in making bsdgrep grep. But I also know that it hasn't happened yet.