3 ms·
Someone please just standardize the grep flags across all platforms. Specifically -P / --perl-regexp support on MacOS and FreeBSD It really would reduce the W
by Joel_Mckay 3y ago
Someone please just standardize the grep flags across all platforms.
Specifically -P / --perl-regexp support on MacOS and FreeBSD
It really would reduce the WTF moments for the students.
Insert jokes about standards below... =)
- burntsushi 3y agoThat's what POSIX was supposed to be. It's easier IMO to just use the same tool on all platforms. Which you can of course do.
- Joel_Mckay 3y agoNot sure if brew's grep is as NERF'ed, but POSIX standard often is just a subset of minimal features for the GNU version. Cheers, =)
- burntsushi 3y agoYes, that's the problem. You need to maintain a close attention level to know which things are POSIX. And in the case of GNU grep, you actually need to set POSIXLY_CORRECT=1. Otherwise its behavior is not a subset. POSIX also forbids greps from searching UTF-16 because it mandates that certain characters always use a single byte. ripgrep, for example, doesn't have this constraint and thus can transparently search UTF-16 correctly via BOM sniffing.