There seems to be a lot of confusion in this discussion about what the change is and how egrep and fgrep work. These are not symlinks like some have suggested but rather shell scripts. You can see the exact commit diff here: https://git.savannah.gnu.org/gitweb/?p=grep.git;a=blobdiff;f... I remember around ~10 years ago being told "you should never use `egrep` because it is slower than `grep -E`." precisely because th…
> "if concerned with performance why are you running code as a shell script" Rewrite grep in python before running - got it. :P
Shell scripts have their place and can out perform most languages if you're writing simple logic that can run across large datasets in parallel, such as
cat very-large-file | grep "do not want" | sed -r 's/foo/bar/' > very-large-file-refactored
(please excuse the useless use of `cat`, it's there to illustrate the direction of data flow)But in those types of scenarios the cost of $SHELL interpretation and fork() is massively outweighed by the savings of stream processing.
So my point was: if you're writing a function which $SHELL interpretation and/or fork() create enough of a performance impact where you're looking to optimize how you exec `grep -E`, then maybe it's time to investigate whether $SHELL is the right language to write your function in.