Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I got this obnoxious whine from egrep on FreeBSD after my latest update. This post made me look, and I had gnu grep install as a dependency for something. Once I removed it, sanity is back and the built-in BSD egrep doesn't whine.

On FreeBSD, they are all the same:

$ ls -li /usr/bin/egrep /usr/bin/fgrep /usr/bin/grep /usr/bin/rgrep

281835 -r-xr-xr-x 4 root wheel 30736 Sep 26 14:37 /usr/bin/egrep

281835 -r-xr-xr-x 4 root wheel 30736 Sep 26 14:37 /usr/bin/fgrep

281835 -r-xr-xr-x 4 root wheel 30736 Sep 26 14:37 /usr/bin/grep

281835 -r-xr-xr-x 4 root wheel 30736 Sep 26 14:37 /usr/bin/rgrep



FWIW, I have no interest in making a similar change to bsdgrep and I can't imagine anyone else would be compelled to bother, either. I just don't see the value in removing these historical names that makes the hassle worth it.


Thanks for sharing. I feel less silly for suggesting this now (as root):

    unalias grep && unalias egrep && cp "$(command -v grep)" "$(dirname "$(command -v grep)")/egrep


why no hard link?


I didn't check where they came from, but on Ubuntu 18.04: egrep, fgrep, and rgrep are shell scripts that call grep with -E, -F, and -r


On FreeBSD, it checks the first character of the program name and modifies behavior based on that. See https://github.com/freebsd/freebsd-src/blob/main/usr.bin/gre...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: