4 ms·
I think the root cause of cat abuse is that grep just takes the parameters the wrong way around. It happens much more often that I want to tweak the pattern and
by dxuh 4y ago
I think the root cause of cat abuse is that grep just takes the parameters the wrong way around. It happens much more often that I want to tweak the pattern and I know which file(s) to grep than the other way around.
- mcbits 4y agoI think it's less that the parameters are the wrong way around and more that the file-reading feature in grep is redundant and could be deleted.
- planede 4y agoExcept when you pass `-r` and you pass a directory in place of the filename. But maybe it should have been `-r <directory>` and still no positional file parameter. The ship has been sailed a long ago though.
- mprovost 4y agoThe newer generation of grep-like utilities (ack, ag, rg) recurse through a directory parameter by default. Of course you could always do this with find.