Hacker News new | ask | show | jobs
by tarxvf 778 days ago
Wait, shell scripts are "arcane"?
4 comments

For sure. It's decades of legacy, many different versions, footguns and caveats everywhere. I personally like to tinker with it, but I also have to look up basic things like "how to write a for loop" or "how to compare numbers" constantly.
That doesn't mean shell scripts are arcane, it just means you don't write shell scripts often enough.
I think it's both.
It's not. Shell scripts are still very much actively used and developed.
That doesn’t make them not arcane
Yes, it does. By definition.
Everything besides YAML is arcane these days.
Absolutely. Anything like bash is not a good language IMO.
"arcane" is not at all the same thing as "not good", anyone who uses a command line is writing bash
"Arcane" means "requiring secret or mysterious knowledge". I think there are quite a few features of bash that qualify as arcane. I've been writing shell scripts for decades and I still have to look up how to do certain things often enough.

And if you want to write in portable shell, remembering all the rules and things you can and cannot do feels somewhat arcane to me.

Sure, but they aren't really writing what I would consider a script/program under typical usage. Obviously that's a fuzzy definition if you start piping things together, but I'm talking more about control flow / parsing argument / etc. Doing that in bash correctly does require arcane knowledge and skills. It is immensely difficult to not shoot yourself in the foot.
They definitely are.