What does "$@@" do? I have used just "$@" for what the script at the end is trying to accomplish, is there some edge case where that fails?
I think that's just the markup for a single @-sign.
(Changes to grep) Time To Stop Using egrep and fgrep Commands, Per GNU grep 3.8
11–20 of 27 posts
Re: (Changes to grep) Time To Stop Using egrep and fgrep Commands, Per GNU grep 3.8
#12Earlier quoted context omitted.
On their own it's probably trivial. I suspect over time it becomes a large tasks/maintenance question. Depending on the number of additional commands on similar removal paths it may have performance/memory improvement implications for minimum supported specs.
I don't think that's why, on my Arch Linux box they're just shell scripts that pass the -E/-F argument to regular Grep. $ cat /usr/bin/egrep #!/bin/sh exec grep -E "$@" $ cat /usr/bin/fgrep #!/bin/sh exec grep -F "$@"
ls -li /usr/bin/grep /usr/bin/egrep /usr/bin/fgrep
285407 -r-xr-xr-x 6 root bin 31896 Aug 14 15:23 /usr/bin/egrep
285407 -r-xr-xr-x 6 root bin 31896 Aug 14 15:23 /usr/bin/fgrep
285407 -r-xr-xr-x 6 root bin 31896 Aug 14 15:23 /usr/bin/grepRe: (Changes to grep) Time To Stop Using egrep and fgrep Commands, Per GNU grep 3.8
#13Earlier quoted context omitted.
On their own it's probably trivial. I suspect over time it becomes a large tasks/maintenance question. Depending on the number of additional commands on similar removal paths it may have performance/memory improvement implications for minimum supported specs.
I don't think that's why, on my Arch Linux box they're just shell scripts that pass the -E/-F argument to regular Grep. $ cat /usr/bin/egrep #!/bin/sh exec grep -E "$@" $ cat /usr/bin/fgrep #!/bin/sh exec grep -F "$@"
I imagine Arch is not using GNU's egrep and fgrep anymore because of the deprecation.
This also answer the question on why is not necessary to GNU to maintain those different commands. Distros can easily shim them to grep if they want to, similar to how a lot of them already link /bin/sh to bash
Re: (Changes to grep) Time To Stop Using egrep and fgrep Commands, Per GNU grep 3.8
#14I feel like this is a pretty silly thing to deprecate. What is the harm in keeping around egrep and fgrep?
Re: (Changes to grep) Time To Stop Using egrep and fgrep Commands, Per GNU grep 3.8
#15alias egrep='grep -E'
alias fgrep='grep -F'
Re: (Changes to grep) Time To Stop Using egrep and fgrep Commands, Per GNU grep 3.8
#16Earlier quoted context omitted.
I don't think that's why, on my Arch Linux box they're just shell scripts that pass the -E/-F argument to regular Grep. $ cat /usr/bin/egrep #!/bin/sh exec grep -E "$@" $ cat /usr/bin/fgrep #!/bin/sh exec grep -F "$@"
Those are not provided by GNU grep, they are an Arch thing (could exist on other distros as well, I'm not sure). The scripts are hand-written for keeping the support with older scripts. I imagine Arch is not using GNU's egrep and fgrep anymore because of the deprecation. This also answer the question on why is not necessary to GNU to maintain those different commands. Distros can easily shim them to grep if they want…
No, they're a GNU grep thing.
GNU grep 3.7: https://git.savannah.gnu.org/cgit/grep.git/tree/src/egrep.sh...
GNU grep 3.8 (with the warning): https://git.savannah.gnu.org/cgit/grep.git/tree/src/egrep.sh...
And you can see that the Arch package isn't doing anything special to add it: https://github.com/archlinux/svntogit-packages/blob/packages...
In general, Arch avoids doing Arch-specific things and prefers to provide vanilla upstream packages, a lot more than other distros avoid doing distro-specific things.
Re: (Changes to grep) Time To Stop Using egrep and fgrep Commands, Per GNU grep 3.8
#17Earlier quoted context omitted.
I don't think that's why, on my Arch Linux box they're just shell scripts that pass the -E/-F argument to regular Grep. $ cat /usr/bin/egrep #!/bin/sh exec grep -E "$@" $ cat /usr/bin/fgrep #!/bin/sh exec grep -F "$@"
interesting, on openbsd they are the same inode and it uses it uses arg0 to figure out what to do. ls -li /usr/bin/grep /usr/bin/egrep /usr/bin/fgrep 285407 -r-xr-xr-x 6 root bin 31896 Aug 14 15:23 /usr/bin/egrep 285407 -r-xr-xr-x 6 root bin 31896 Aug 14 15:23 /usr/bin/fgrep 285407 -r-xr-xr-x 6 root bin 31896 Aug 14 15:23 /usr/bin/grep
- Based on the NEWS file, it sounds like pre-v2.0 (1993) versions had totally separate implementations for each program and didn't have -E, -F, or -G flags (but only history back to 1998 has been imported to Git, and I don't feel like digging up old tarballs to verify)
- In the first revision checked in to Git (1998), it's argv[0]-inspecting, but the program is compiled identically 3 times, rather than being hardlinked or symlinked. https://git.savannah.gnu.org/cgit/grep.git/commit/?id=06b9f7...
- In v2.2c (1998) it changed to be 3 separate binaries https://git.savannah.gnu.org/cgit/grep.git/commit/?id=f76209...
- In v2.5 (2002) it changed to be argv[0]-inspecting hardlinks https://git.savannah.gnu.org/cgit/grep.git/commit/?id=f620c9...
- In v2.5.1 (2002) it changed to be shell scripts https://git.savannah.gnu.org/cgit/grep.git/commit/?id=5cb71b... - In v2.5.2 (2005) it changed to be 3 separate binaries (the `fgrep` binary being a lot smaller than the `grep` binary) https://git.savannah.gnu.org/cgit/grep.git/commit/?id=d25beb...
- In v2.19 (2014) it changed back to shell scripts https://git.savannah.gnu.org/cgit/grep.git/commit/?id=b63964...
Re: (Changes to grep) Time To Stop Using egrep and fgrep Commands, Per GNU grep 3.8
#18Earlier quoted context omitted.
On their own it's probably trivial. I suspect over time it becomes a large tasks/maintenance question. Depending on the number of additional commands on similar removal paths it may have performance/memory improvement implications for minimum supported specs.
Does it though? I mean we’re really talking about a teeny tiny little startup code to read arg0 and use it to do the equivalent of passing -E or -P.
[1]: 11 lines at the longest, 2 lines at the shortest; currently 4 lines
https://git.savannah.gnu.org/cgit/grep.git/tree/src/egrep.sh...
Re: (Changes to grep) Time To Stop Using egrep and fgrep Commands, Per GNU grep 3.8
#19What's the rational for keeping them around in new installs? How have others handled command deprecation on the past? May this also serve as a warning about adding functionality and being very careful about removing it.
Re: (Changes to grep) Time To Stop Using egrep and fgrep Commands, Per GNU grep 3.8
#20Earlier quoted context omitted.
interesting, on openbsd they are the same inode and it uses it uses arg0 to figure out what to do. ls -li /usr/bin/grep /usr/bin/egrep /usr/bin/fgrep 285407 -r-xr-xr-x 6 root bin 31896 Aug 14 15:23 /usr/bin/egrep 285407 -r-xr-xr-x 6 root bin 31896 Aug 14 15:23 /usr/bin/fgrep 285407 -r-xr-xr-x 6 root bin 31896 Aug 14 15:23 /usr/bin/grep
GNU has flip-flopped on it. - Based on the NEWS file, it sounds like pre-v2.0 (1993) versions had totally separate implementations for each program and didn't have -E, -F, or -G flags (but only history back to 1998 has been imported to Git, and I don't feel like digging up old tarballs to verify) - In the first revision checked in to Git (1998), it's argv[0]-inspecting, but the program is compiled identically 3 times…
I didn't like the arg0 magic, so I'm happy that is gone. Funny to think I had to be in the right time window to even notice that.