3 ms·
This is a benefit of Oil, and part of the reason for it! I don't think having a hard "fork" between POSIX/bash and another shell is desirable. So Oil is almos
by chubot 6y ago
This is a benefit of Oil, and part of the reason for it! I don't think having a hard "fork" between POSIX/bash and another shell is desirable.
So Oil is almost indistinguishable from bash at first, but you can unlock more powerful functionality with the var and proc keywords, etc.
This page has the old sh and new Oil idioms, but importantly Oil runs all the old stuff!
http://www.oilshell.org/release/latest/doc/idioms.html http://www.oilshell.org/release/latest/doc/idioms.html
- CyberRabbi 6y agoPOSIX compatibility would be enough to make oil a legitimate replacement shell for me but the bash compatibility makes it stand out as an alternative to take seriously. Does oil allow a gradual upgrade path to using oil semantics for stuff like “echo $dontbreak”? Are there “set” options that enable oil semantics? Sort of like “use strict” in JavaScript and perl
- chubot 6y agoYes that's exactly how it works, with shell options! http://www.oilshell.org/blog/2021/01/why-a-new-shell.html#how-can-you-design-a-good-language-on-top-of-shell http://www.oilshell.org/blog/2021/01/why-a-new-shell.html#ho... I need to document things a bit better but the idea is here: https://lobste.rs/s/ritbgc/what_glue_lanugages_do_you_use_like#c_la5m5a https://lobste.rs/s/ritbgc/what_glue_lanugages_do_you_use_li... In the case of echo, we respect -e and -n, but we also have "write -- -n" for correctness. I try not to "stomp" on existing names. --- And yes there's an analogy to Perl: http://www.oilshell.org/blog/2020/07/blog-roadmap.html#the-unix-shell-should-evolve-like-perl-5 http://www.oilshell.org/blog/2020/07/blog-roadmap.html#the-u...