3 ms·
Yup, in terms of ls $a -- YSH happens to be like zsh. OSH is compatible with bash and does the POSIX word splitting, but YSH is not. In general YSH is pretty
by chubot 2y ago
Yup, in terms of ls $a -- YSH happens to be like zsh. OSH is compatible with bash and does the POSIX word splitting, but YSH is not.
In general YSH is pretty different than zsh though -- it's more of a Python- JS-like language with structured data, e.g.
ysh$ var a = ['list', 'of' strings']
ysh$ write -- @a
list
of
strings
In zsh I still think that's the pretty obscure "${a[@]}" rather than @a.
Arrays are also "flat" in zsh -- you can't have an array of arrays, because there's no garbage collector. But YSH has arbitrarily nested JSON-like data structures, and JSON serialization built in.
I need to put some code examples on the home page, but for now - https://www.oilshell.org/release/latest/doc/ysh-tour.html https://www.oilshell.org/release/latest/doc/ysh-tour.html