News for hackers. Stuff that matters.
Re:For the Love of Pipes by Poiesis on Tuesday January 22, 2019 @05:40PM (#18973370)
In my opinion, it's perfectly fine either way unless you're worried about performance. I personally tend to try to use the more performant option when there's a choice, but a lot of times it just doesn't matter.

That said, I suspect the example would be much faster if you didn't use the pipeline, because a single tool could do it all (I'm leaving in the substitution and column print that are actually unused in the result):

    awk '/^x/{gsub("a","b");print $2; count++}END{print NR}' foo.txt

There are no comments on this comment yet.