3 ms·
I'm pretty fanatical about efficiency, but it's kind of annoying to have to remember where in the argument sequence for a whole bunch of commands the input file
by jacquesm 9y ago
I'm pretty fanatical about efficiency, but it's kind of annoying to have to remember where in the argument sequence for a whole bunch of commands the input file goes.
Of course once you use the 'cat' trick you then have to remember which comments require '-', '-f -' or something to that effect because whoever programmed them didn't think the primary use case was to work as a filter.
Pipes are one of Unix's most useful features and cat somefile | asequenceofusefulcommands is a shorthand that anybody should be able to use.
- iforgotpassword 9y agoAs a compromise you could just do "< infile grep word | awk '{...}' | sort" so you still have the input file first but got rid of cat ;)
- jacquesm 9y agoTyping speed has never been my handicap. To me this seems like just another case of premature optimization, the fact that you are typing in a command is a pretty good indication it is a one-off.
- deleted 9y ago[deleted]
- jacquesm 9y agos/comments/commands/ sorry.