Re:Old box, dumb code, few thousand connections, no big deal
by EdwardDiego on Friday May 08, 2020 @12:20AM
(#23111347)
> reimplement it in bash
> more debuggable / readable
More debuggable / readable for you, perhaps.
Re:Old box, dumb code, few thousand connections, no big deal
by arpa on Friday May 08, 2020 @01:50AM
(#23111781)
Hey, for me too. But then again I used to write bash frameworks for fun so there's that.
Re:Old box, dumb code, few thousand connections, no big deal
by pjc50 on Friday May 08, 2020 @05:56AM
(#23113047)
Given how badly bash goes wrong if spaces in filenames sneak in, or if you want to do error handling, at several places I've had a policy of rewriting scripts from bash into python. It has the advantage that it's usually a better cross-platform solution than running bash on Windows.
If I find myself debugging python tools, I usually just add debug statements to figure out WTF it is trying to do, and reimplement it in bash. It invariably is less than 10% as many lines of code, and also more debuggable / readable than the original.
Granted, most of the python scripts I see these days are build processes or cluster coordinators.