3 ms·
> I haven't seen any other tool ever have so many pitfalls. I haven't seen any other tool with so much general utility and availability. > to loop over a stri
by akira2501 2y ago
> I haven't seen any other tool ever have so many pitfalls.
I haven't seen any other tool with so much general utility and availability.
> to loop over a string array and print its contents
Is incredibly easy in bash and bash like shells. As highlighted the issue is that tools like 'ls' don't create "a string array." They create one giant string that has to be parsed. The rules in the shell are different than in other languages but it /will/ do most of the parsing for you, or all of it, if you do it carefully.
This is a fine tradeoff. As evidenced by it's wide usage and lack of convincing replacements.
- anal_reactor 2y ago> I haven't seen any other tool with so much general utility and availability. > availability That's the real reason why we use Unix shell. It's not good, but it's available. Like a cheap hooker. > but it /will/ do most of the parsing for you, or all of it, if you do it carefully. "It mostly works if you're careful" doesn't sound very convincing to me.