2 ms·
> Who wants to have to be an expert in shell scripts to have to write them? If you aren't good with shell scripts, why bother? Go use Python or something else
by qweqwe14 3y ago
> Who wants to have to be an expert in shell scripts to have to write them?
If you aren't good with shell scripts, why bother? Go use Python or something else entirely. And it's not like you would use shell scripts to write all your programs, they aren't suitable for anything more complex than stiching a bunch of programs together anyway, yet people still try. And then those people complain that shell script is full of "footguns" when they are misusing it.
> Trivial to do so that it works for you. Absolutely not trivial to do so that it always works.
No idea what you are on about, literally every single detail you need to correctly parse /proc entries is in proc manpage. And yes, if you wrote your parser correctly it will still work between kernel versions, because /proc is considered a stable API between the kernel and userspace (same as syscalls). There are no "footguns" and no mysteries to it. It's a solved problem. Provide a concrete example of a footgun if there is one, and by "footgun" I mean something that isn't clearly stated in the manual that everyone dealing with /proc reads (right?)
- IshKebab 3y agoYou have a fundamental misunderstanding of footguns, and humans. Explaining them is in manual doesn't mean they no longer exist. People often don't read the manual. Nor should they have to. > If you aren't good with shell scripts, why bother? Go use Python or something else entirely I agree! And given that essentially nobody is "good with shell scripts" we can simplify that advice to "don't write shell scripts".
- qweqwe14 3y ago> People often don't read the manual. Nor should they have to. That's some kind of logic right there. If people don't read the manual, they have every right to expect that things will break. It's not surprising or shocking, it's just user error. > we can simplify that advice to "don't write shell scripts". No, we cannot simplify it like that. Shell scripts are a brilliant tool for a certain kind of problem, and they work well when used for that class of problem. When used for anything else, they work poorly. Same applies for literally any other tool. It's like saying "essentially nobody is good with a CNC machine so don't use it"
- IshKebab 3y ago> If people don't read the manual, they have every right to expect that things will break. This is just fundamentally and absolutely wrong. Completely incorrect. I could explain it, but others have done better: https://en.wikipedia.org/wiki/Principle_of_least_astonishment https://en.wikipedia.org/wiki/Principle_of_least_astonishmen... https://notes.rmhogervorst.nl/post/2022/11/21/what-is-a-footgun/ https://notes.rmhogervorst.nl/post/2022/11/21/what-is-a-foot... https://fstoppers.com/opinion/stop-telling-people-read-manual-512473 https://fstoppers.com/opinion/stop-telling-people-read-manua... I also recommend the book "The design of everyday things" which isn't about software but the lessons in it are highly applicable. Good luck learning!