2 ms·
A shell for loop is not arcane — that's one of the shell's most basic control structures. It uses one fewer external command (no "find"), which is a great way t
by Symbiote 10y ago
A shell for loop is not arcane — that's one of the shell's most basic control structures. It uses one fewer external command (no "find"), which is a great way to avoid the weird (and common) corner cases.
But anyway, I think you missed where I wrote, "treating the output as objects would be an improvement", and presented a better example in support of your suggestion.
- Udo 10y ago> But anyway, I think you missed where I wrote, "treating the output as objects would be an improvement" We already agree about that part (at least sort of). Instead I wanted to address the part where you declared my example invalid and where we're talking about nothing else but the details of this one example. Did I choose it poorly? Was it too simplistic? Maybe, it really depends on your tastes. I content that arguing about whether or not the find command is usefully implemented is besides the point. The problem lies deeper and is more systemic than that. I'm not arguing that a loop construct is arcane, I'm arguing that in practice such scripts turn arcane really quickly, and that there is something substantial to be gained from having tools exchange information in a structured, machine-centric format - and also from switching to a human-centric control format.