5 ms·
I propose a new project: lessutils. You post about some program that you use for some simple task that's not among the "standard UNIX utils". (ed, sed, AWK, le
by sigcode 10y ago
I propose a new project: lessutils.
You post about some program that you use for some simple task that's not among the "standard UNIX utils". (ed, sed, AWK, lex, etc.)
Then we show you how to do the same task with only the standard utils. (i.e. no install needed) -- inevitably someone shows us how to do it in AWK and makes all feel stupid. :)
If we are successful, you get to eliminate one more dependency from your system, not to mention reducing attack surface.
- spinningarrow 10y agoHere's one I use: jq for JSON parsing
- cben 10y agoYes. letsencrypt.sh is a nice case study, spending a lot of effort to parse json with essentially bash & grep. It works now but is full of assumptions ("this array of hashes will not contain [ anywhere"). There is nothing in POSIX that's well suited to manipulating json in the way that jq is.
- sigcode 10y agoMay I suggest an "Ask HN." Show your .json input and the desired output.
- icebraining 10y agonot to mention reducing attack surface. Unless the programs are setuid, is that a real problem? I mean, anyone who can call one of these utilities with some arguments can also call "sh -c ...", no?
- rbanffy 10y agoEvery attack surface is a problem. More code means more places bugs can happen and more risk, even if the risk is low. Your parachute may be very reliable but if you keep jumping off planes you'll eventually die.
- icebraining 10y agoMy point is that if you have a meter-wide hole in your parachute (sh and other interpreters you can call to execute any code you want), also having small rips in the fabric probably doesn't really matter - if you have to rely on it, you're screwed anyway.
- rbanffy 10y agoAs long as you know you have a meter wide hole you will care enough to guard it. Thousands of smaller holes will eventually go forgotten.
- stepvhen 10y agothe suckless people are doing this wih the coreutils, titled sbase. they adhere to POSIX and nothing else, really http://core.suckless.org/sbase http://core.suckless.org/sbase