|
|
|
|
|
by kazinator
1287 days ago
|
|
> It really demonstrates that you don't have the usage of the command receiving the output completely memorized. No, it demonstrates that you don't have redirection memorized, and don't know that you can place it anywhere in the command line, including on the left. > So you're wasting a few clock cycles Keystrokes too: cat x | cmd
< x cmd
It's also possible that cmd may detect that its standard input is connected to a real file, and take advantage of being able to lseek() the file descriptor. For instance say that x is an archive and cmd is an extractor. If cmd needs to skip some indicated offset to get to the desired payload material, it may be able to do it efficiently with an lseek, whereas under cat, it has to read all the bytes and discard them to get to the desired offset. |
|