Comment by hello_computer
7 days ago
There are so many neo-shells that go crazy with colors, autocompletions, & SQL-like features while the most basic problems (like handling of newlines/spaces/international chars) are mostly swept under the rug with -null/-print0, which is more hack than solution. I think Tom Duff's rc shell was an excellent start in that direction, which sadly went nowhere.
YSH addresses the "string safety" problem:
What is YSH? https://oils.pub/ysh.html
I am writing a quoting module now, but the key point is that it's a powerful enough language to do so. It is more like Python or JS; you don't have to resort to sed to parse and quote strings.
I posted the quote-argv solution above -- in YSH it will likely be:
But you can write such a function NOW if you like
---
quote.sh follows the (subtle) idiom of replacing a single quote ' with
which means it works on systems with remote POSIX sh, not just YSH !
e.g. "isn't" in POSIX shell is quoted as
which is these three word parts:
YSH also has:
- JSON, which can correctly round trip every Unicode string, without writing your own parsing functions
- JSON8, an optional extension that can round trip every byte string you get from the Unix kernel
https://oils.pub/release/latest/doc/j8-notation.html
I like it. Hope it gets some traction.
It also fixes the problem with eval that is shared with ssh:
And it fixes word evaluation
YSH Doesn't Require Quoting Everywhere - https://www.oilshell.org/blog/2021/04/simple-word-eval.html
https://oils.pub/release/latest/doc/simple-word-eval.html
To be fair, most of those "basic problems" have basic solutions as long as you're not trying to avoid GNU tools.
The nastiest case is probably `globasciiranges`.