4 ms·
On my system, egrep and fgrep are _already_ shell scripts, just changed to add the stupid warning: $ cat =egrep =fgrep #!/bin/sh cmd=${0##*/} e
by aftbit 4y ago
On my system, egrep and fgrep are _already_ shell scripts, just changed to add the stupid warning:
$ cat =egrep =fgrep
#!/bin/sh
cmd=${0##*/}
echo "$cmd: warning: $cmd is obsolescent; using grep -E" >&2
exec grep -E "$@"
#!/bin/sh
cmd=${0##*/}
echo "$cmd: warning: $cmd is obsolescent; using grep -F" >&2
exec grep -F "$@"
Looking at src/egrep.sh in the git repo[1], I see that before this warning was added in 2021, the last change was back in 2015. In fact, since the git repo history began in 1998, there have been a total of 4 changes to this file. Clearly the maintenance burden of these scripts is not sufficient to require the maintainers to drop them. My guess... this is being done out of some weird sense of purity over practicality. Bad call by Paul Eggert IMO[2].
1: https://savannah.gnu.org/git/?group=grep https://savannah.gnu.org/git/?group=grep
2: commit a9515624709865d480e3142fd959bccd1c9372d1 added the warnings
- yjftsjthsd-h 4y ago> cat =egrep =fgrep What is that? I can't seem to find it by searching for " =" in `man bash`
- professoretc 4y agoIn ZSH `=executable` expands to the full path of `executable`.
- deleted 4y ago[deleted]
- pwagland 4y agoThis is a zsh thing, it's shorthand for: cat "$(which egrep)" "$(which fgrep)"
- deleted 4y ago[deleted]
- sprremix 4y agoIt's a zsh thing. 14.7.3 ‘=’ expansion If a word begins with an unquoted ‘=’ and the EQUALS option is set, the remainder of the word is taken as the name of a command. If a command exists by that name, the word is replaced by the full pathname of the command. From: https://zsh.sourceforge.io/Doc/Release/Expansion.html#g_t_0060_003d_0027-expansion https://zsh.sourceforge.io/Doc/Release/Expansion.html#g_t_00...
- kccqzy 4y agoIf you have interacted with Paul Eggert in real life (I have; he's a professor at UCLA), you would've known that he is a man that values purity over practicality. Not surprising at all.
- Phelinofist 4y agoIs it the same guy that maintains tzdb? https://lwn.net/Articles/870478/ https://lwn.net/Articles/870478/
- kccqzy 4y agoYes he is. He's a maintainer for a lot of GNU software including Emacs, sort, etc. Running fgrep -U -l -r "Paul Eggert" /usr/bin should turn up quite a few results. (That's of course an undercount because he doesn't always put his name into everything he touches.)
- teo_zero 4y agoYou surely mean grep -F -U -l -r "Paul Eggert" /usr/bin Don't you?