3 ms·
I believe what puts people off shell (myself included) are the various arcane caveats (eg. spaces after or before operators) and little language quirks. It does
by stelonix 6y ago
I believe what puts people off shell (myself included) are the various arcane caveats (eg. spaces after or before operators) and little language quirks. It does not seem intuitive and since there are better alternatives like Python, I won't bother to learn some 70s string-based language.
- indymike 6y agoThe irony in this is that I'm pretty sure that 70's era string-based languages are better designed than many, many configuration file formats.
- pwm 6y agoI highly recommend https://github.com/koalaman/shellcheck https://github.com/koalaman/shellcheck It's a wonderful piece of software to help and guide users writing shell scripts. Hook it up to your editor/IDE and all those arcane caveats will be things of the past.
- chubot 6y agoI agree that's what puts people off, and that's the rationale for Oil, an upgrade of Unix shell. In fact I mention the spaces issue in the The Simplest Explanation of Oil: https://www.oilshell.org/blog/2020/01/simplest-explanation.html https://www.oilshell.org/blog/2020/01/simplest-explanation.h... More: http://www.oilshell.org/blog/2021/01/why-a-new-shell.html http://www.oilshell.org/blog/2021/01/why-a-new-shell.html You can use it right now as a dev tool. If you use ShellCheck to statically check it, then running your script under Oil is complementary (and it also has some static checks): https://www.oilshell.org/why.html https://www.oilshell.org/why.html
- stelonix 6y agoYeah I'm a big fan of Oil and hopefully in 10-20 years it'll be the standard language of shells. Also I did notice the spaces issues when attempting shell but it was only from reading your post sometime ago that I found out it was a deliberate language design choice.
- chubot 6y agoIt should be usable for "cloud config" files long before that! :) But yes changing existing code at the lower distro level has a lot more inertia. The cloud is basically built on top of Linux distros, so that part is easier to change and is rapidly evolving. You could say that the = issue is deliberate, but I'd say the core problem is that shell didn't start out as a programming language, or at least it was a very impoverished one without variables. The original paper from the 70's on the Thompson shell shows that. Shell had "goto" but no variables! So name=value had to be grafted on later without breaking too many things. Words were already split by spaces, so I guess they just made name=value a "pseudo-word" that becomes an assignment, whereas name = value remained 3 words.