3 ms·
The use of cat is not useless. Having a "read this file" command be the source of the pipeline makes a lot of sense. It makes it seamless to replace the cat wit
by mort96 4y ago
The use of cat is not useless. Having a "read this file" command be the source of the pipeline makes a lot of sense. It makes it seamless to replace the cat with a pv if you want progress, zcat if you're reading a gzipped file, curl if you want to use a URL, etc.
- codetrotter 4y agoFair point. But how often do you make those kinds of changes in any of your scripts and not have to change anything? For me, exactly 0 times
- mort96 4y agoQuite frequently? "Oh this operation turned out to take a while, I'll use pv instead of cat", or "oh what I grepped for wasn't in the current log, it's probably in the previous log that's gzipped, I'll replace 'cat current.log' with 'zcat previous.log'".
- asda22sdasd 4y agoSounds like you describe a interactive shell session, not stuff that happens in that script that was written for a specific purpose.
- coldtea 4y agoYou'd be surprised
- pseudalopex 4y agoThe 1st scenario and things similar to the 2nd happen in script development.