3 ms·
Yeah, you are right, it's about syntactic sugar, I didn't read the article except first two examples. Pipelines are about iteration, of course. And they do hav
by EVa5I7bHFq9mnYK 1y ago
Yeah, you are right, it's about syntactic sugar, I didn't read the article except first two examples.
Pipelines are about iteration, of course. And they do have internal logic around iteration.
cat largefile.txt | sort | uniq --count
is an excellent example. While cat and count iterate on each character sequentially, sort and uniq require buffering and allocating additional structures.
- hnlmorg 1y agoThe pipeline isn’t doing any of that though. The commands are. The pipeline is just connecting the output of one command to the input of the other. Iteration is about looping and if the pipeline in the above example was some kind of secret source for iteration then the commands above would fork multiple times, but they don’t.