3 ms·
I often use cat and pipe to grep, it's nicer to have a left -> right flow.
by chrisbroadfoot 14y ago
I often use cat and pipe to grep, it's nicer to have a left -> right flow.
- lindvall 14y agoEnds up that passing the file directly to grep will allow it to use tricks to make processing faster than reading from a pipe.
- ralph 14y agoI don't like it, but you can do <foo grep bar | ... if you really want L-to-R whilst avoiding the redundant cat and its overhead. That doesn't allow grep to do its speed-ups though, because it's still reading stdin, not a filename.