12 ms·
Perl Regex Removed From Grep in Mountain Lion
- lutusp 14y agoThis contradicts a clear historical trend in which Perl regex syntax and POSIX regex syntax (not the same) are being more widely adopted as time passes. It's a definite step backward.
- Hemospectrum 14y agoThis wasn't a deliberate decision on Apple's part to remove this particular functionality. Rather, they switched to a different implementation of grep (BSD instead of GNU) and it leaves out PCRE support by default. If word of this gets back to whoever made the change, it should be a simple matter to reenable it for future versions of OS X.
- cefstat 14y agoApparently pre-10.8 the grep program that came with Mac OS X was GNU grep. 10.8 comes with BSD grep.
- hollerith 14y agoIt's definitely GNU grep on 10.7.5.
- zem 14y agosomething i'm curious about - for linux fans who have made the switch, is osx an "acceptable unix"? people keep trumpeting the fact that it combines the best of both worlds, a seamless gui experience atop a full-fledged posix core complete with a bash prompt you can drop down to as easily as you can in linux, but philosophically it seems that for the little things like package management, command line utilities, etc., the experience is closer to cygwin than it is to linux proper - you can do it, sure, but it will involve falling back to a third-party ecosystem.
- iwejfweoifjweif 14y agoIts not close to GNU tools but its very true to Unix tools. Many of the tools have the same options (if not the same man pages) as their Free/Open/NetBSD versions.
- zem 14y agoah - that's an interesting distinction. i guess linux has gotten me subconsciously used to thinking of the gnu tools as the current unix standard.
- tingletech 14y agobut (by recursive definition) GNU is Not Unix
- dguaraglia 14y agoOh, no, the experience is way better than Cygwin. Cygwin feels exactly like what it is a: bolt-on trying to emulate features and filesystem structures of a completely alien OS. It feels clunky, what you see when you do 'ls' at the 'root' of your filesystem is completely different to what you see when you 'dir' (or use the Windows Explorer.) OS X is a completely different story. If you ever used BSD before, you know how it feels 'almost' like linux, barring a few differences. It's the same with OS X. Besides package management (which is greatly alleviated by Homebrew) and so-so integration of X applications, I can't say I miss my Ubuntu laptop at all.
- smosher 14y agoMy Cygwin experience has been quite authentic actually. But I was cheating, I'd use it for SSH and rxvt in combination with xming to establish a forwarded X session. (And x-mouse and alt-drag for that nearly authentic mouse behaviour.) Desperate times, desperate measures.
- tomwalsham 14y agoThese sorts of issues (primarily related to auxiliary functions in grep, sed, etc) can cause portability issues when developing locally for linux systems, but no worse thanks, say, writing for fedora on an Ubuntu box. Brew is okay but a bit sparse. For me I mostly miss Gnome
- js2 14y agohttp://wiki.freebsd.org/BSDgrep http://wiki.freebsd.org/BSDgrep BSD grep has been imported to 9.0-CURRENT on July 22, 2010. It has been obtained from the OpenBSD and the FreeGrep projects to make it appropriate for our needs to provide GNU compatibility and let ports build without problems. GNU compatibility is almost 100%, the only missing feature is -P (--perl-regex), which is not possible to support without having PCRE in base system and anyway, it was disabled in GNU grep for the same reason. Somewhat ironic as OS X includes PCRE. Not sure why Apple didn't stay with GNUgrep.
- Hemospectrum 14y agoSince the introduction of the GPL3, there's been a steady purge of GNU software from OS X. This is why Apple's GCC, bash, etc. are stuck at old versions lacking a variety of useful features. I'm kind of curious what they'll do about Emacs. It doesn't have a BSD-licensed counterpart like everything else they've removed... Maybe they'll just leave it out.
- smosher 14y agoSince the introduction of the GPL3, there's been a steady purge of GNU software from OS X. Is it all GNU software that's being purged, or just the GPLv3 licensed stuff? If the latter, I can't say I blame them. The former case can go either way but I guess it's good to future-proof early.
- Hemospectrum 14y agoAs far as I know, all GNU software went to GPLv3. Literally all of it. Even things with no substantial updates since 2007.
- gizmo686 14y agoIsn't (one of) the points of the GPL that you cannot change the licensing of the software?
- jevinskie 14y agoThis bit me in our "golden file" checking portion of our product's test suite. I moved the golden file checking regex to a Perl script. Apple's obsession with removing GNU utilities has been annoying but I suppose the test suite should have taken grep portability problems into account.
- james2vegas 14y agoYes it should have. You could still run into problems as PCRE regexes are not quite the same as Perl regexes. Why not just check for and use pcregrep?
- deleted 14y ago[deleted]