|
|
|
|
|
by Sir_Cmpwn
2732 days ago
|
|
I don't see sh as a losing battle. I actually think it's quite good for the niche it aims to serve - a niche that very much exists, sh is a square peg and should only go in square holes. I think most folks have had their impression of POSIX shell tainted by bad shells like bash and - sorry - oil encouraging complex, non-portable shell scripts. I intend to write more blog posts in the future helping people gain a closer understanding of POSIX shell and how/where it's useful and how to use it. |
|
I could see that perhaps low level scripts need to be portable to different Unixes. But again I would say that's maybe 5% of what shell is good for.
Also, someone once said "it's easier to port a shell than a shell script". So that's why I'm paying careful attention to Oil build dependencies. For example, Rust and Go are significantly less portable than C, and Oil is self-contained C if you look at it the right way :)
----
EDIT: Also I think there's no problem adding local variables to POSIX, since all shells implement the same way as far as I can tell. That would be the much better solution, rather than trying to convince people to use only globals.
There are many useful / real shell scripts that are thousands of lines long, so you really need locals.