3 ms·
> > The cost of egrep and fgrep is just two symbolic links. > A cost that needs to be paid every time you invoke them (a double lookup in the filesystem). Just
by Maursault 4y ago
> > The cost of egrep and fgrep is just two symbolic links.
> A cost that needs to be paid every time you invoke them (a double lookup in the filesystem). Just use a regular link.
I'm having a bit of trouble understanding the outrage. Can't all egrep/fgrep in all scripts be fixed once in one or two commands and remain fixed?
$ sed -i 's/fgrep/grep\ -F/' *.sh
(or something)
I see it as getting accustomed to bells and whistles on some modern shell (like tab completion on zsh and others), then having to use a shell on another system without them (some ragged old korn) and getting tripped up... and the ultimate solution is to be conscious that these things don't work everywhere, so don't be too reliant on them.
- gumby 4y agoHow would you find every script given that people download all sorts of scripts all the time? What about docker images? And that doesn't even open the can of worms relating to quoting...
- Maursault 4y agoIf we don't know where our scripts are, we have much deeper issues, but still not insurmountable. $ sed -i 's/fgrep/grep\ -F/' $(grep -rw '/' -e 'fgrep') (or something) I don't manage docker images, but surely there must be a way to do something as simple as replace a file in one image,[1] and if that can be done, doing so in all images is just one clever step away. [1] https://stackoverflow.com/questions/40895859/how-can-i-overwrite-a-file-through-dockerfile-in-docker-container https://stackoverflow.com/questions/40895859/how-can-i-overw...