zlacker

[parent] [thread] 12 comments
1. zeveb+(OP)[view] [source] 2018-11-12 23:41:15
> But, if you pull up the manual page for something like grep, you will see that it has not been updated since 2010 (at least on MacOS).

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.

replies(4): >>skissa+N >>setr+j2 >>dylan6+Oa >>JdeBP+YJ
2. skissa+N[view] [source] 2018-11-12 23:49:41
>>zeveb+(OP)
> 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.

3. setr+j2[view] [source] 2018-11-13 00:07:14
>>zeveb+(OP)
Iirc, Apple stopped updating but continued shipping all gnu utilities since gplv3 was attached to them
replies(1): >>LukeSh+Qb
4. dylan6+Oa[view] [source] 2018-11-13 01:39:13
>>zeveb+(OP)
> Strange that Apple would be shipping such an ancient grep.

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.

◧◩
5. LukeSh+Qb[view] [source] [discussion] 2018-11-13 01:52:02
>>setr+j2
I don't believe that macOS grep was ever GNU grep. I believe that macOS always used a BSD variant of grep.
replies(2): >>privon+Ud >>yesena+Hk
◧◩◪
6. privon+Ud[view] [source] [discussion] 2018-11-13 02:15:02
>>LukeSh+Qb
For what it's worth, on a not-too-old Mac:

  $ 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.
◧◩◪
7. yesena+Hk[view] [source] [discussion] 2018-11-13 03:33:12
>>LukeSh+Qb
Using OS X 10.4.11 here, the grep file is dated Jan 2006, the end of the grep man pages says "2002/01/22".

  $ 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.
replies(1): >>LukeSh+zo
◧◩◪◨
8. LukeSh+zo[view] [source] [discussion] 2018-11-13 04:15:10
>>yesena+Hk
Interesting. What does `type grep` say? Is it possible that it's /usr/local/bin/grep from homebrew/macports/…, and that /usr/bin/grep is BSD grep?

I found a comment claiming that prior to 10.8 (2012, Mountain Lion) it used GNU grep, but nothing I'd feel comfortable citing.

replies(1): >>yesena+hw
◧◩◪◨⬒
9. yesena+hw[view] [source] [discussion] 2018-11-13 06:17:31
>>LukeSh+zo

  $ 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.
10. JdeBP+YJ[view] [source] 2018-11-13 09:59:06
>>zeveb+(OP)
Be aware if you are going to delve into history that grep is the source of much confusion, in part because exactly which program was grep on some systems has changed over the years. On FreeBSD, for example, some years ago grep was the GNU tool and the BSD tool was named "bsdgrep". They would both identify as the same version number.
replies(1): >>loeg+Qx2
◧◩
11. loeg+Qx2[view] [source] [discussion] 2018-11-14 02:03:46
>>JdeBP+YJ
> On FreeBSD, for example, some years ago grep was the GNU tool and the BSD tool was named "bsdgrep". They would both identify as the same version number.

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 1300003
replies(1): >>JdeBP+I83
◧◩◪
12. JdeBP+I83[view] [source] [discussion] 2018-11-14 11:25:01
>>loeg+Qx2
Tut-tut! So easily demonstratable otherwise.

MacOS:

* 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:

* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201650

replies(1): >>loeg+xG3
◧◩◪◨
13. loeg+xG3[view] [source] [discussion] 2018-11-14 16:41:08
>>JdeBP+I83
MacOS isn't FreeBSD. They're free to do whatever they want with the BSD-licensed software. Your comments made claims about FreeBSD that weren't factual. I would also emphasize that:

    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.
[go to top]