6 ms·
One good reason (IMO) for doing "cat file |" is it's easier to grab the command from your history and change it to something like "grep foo file |" rather than
by jfhufl 8y ago
One good reason (IMO) for doing "cat file |" is it's easier to grab the command from your history and change it to something like "grep foo file |" rather than if you had run "cmd < file".
- jgtrosh 8y agoMy counter argument would be that with a good shell line editor like zsh in vi mode command transformations are as cheap as modular grammar; however I know there's limits to that argument (Java is only writeable in Java IDEs) so I'll grant you that :-)
- waterhouse 8y agoAlso, if you have a long pipeline: cat file | this | that | other | out vs this < file | that | other | out In the cat example, it's easy to change the head of the pipeline, by adding things before "this" or deleting "this", which is less so in the non-cat example. (The use case I have in mind is experimental commands that take probably <10s to complete, where editing time is a significant fraction of the time you spend.)
- deleted 8y ago[deleted]
- iforgotpassword 8y ago< file this | that | other | out
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]