I like Xonsh, it’s pretty nice to work with, but it makes going back to Bash, when I have to, even more painful.
I like Xonsh, it’s pretty nice to work with, but it makes going back to Bash, when I have to, even more painful.
Gonna try nushell soon as that seems even more productive.
its all a bunch of loops and string manipulation in the end. in fact, awk can handle a whole lot of it too! and octave... and others, lol; so long as it does not turn into the python2 to python3 fun we've had in the past and we have some stability between versions; this is why i still choose bash (and the whole gnu binaries)
edit (formatting i hope, and python)
Blegh, now I have to do some digging...
I think the one that catches me off guard the most is:
export FOO=bar
BAZ=qux
Is now $env.FOO = "bar"
BAZ = "qux"
It makes more sense the nu way, but old habits die hard.For short snippets, better to read, understand, and translate as you type.
For some shell integrations or environment setup tools, use fenv or babelfish.
For scripts of any length, just save it and run it. The shebang'll invoke bash or whatever is needed.
$ [1, 2] | math max
2
And here are some strings: $ ["a", "c"] | str join "b"
abc
And there are tables $ [
{name: "foo", value: 6},
{name: "bar", value: 9}
] | where value > 7 | get name
bar
And that's about as weird as the types get.I prefer sticking with bash where necessary (where a script is the only thing that will reasonably work), and elsewhere using a programming language with testing, type checking, modularity, and compilation into something with zero or minimal runtime dependencies.
I try to use posix standards when convenient, but I'll switch to bash at the first sign of posix complexity.
Xonsh seems like I'd have to type a lot more than I do with zsh. I would also be concerned about not being able to give my team members the same command I used without forcing them into a non-standard shell.
I don't use fish because I've only met one other person IRL who used it. Everyone I've worked with has use bash, zsh, or ksh (I'm glad I left the ksh company before they had to rewrite all those ksh scripts).
Also, Bash is staying for now. posix will most likely always work for the foreseeable future. Zsh seems to be the new Bash, but I have yet to see anyone put zsh in a shebang at work.
I put it in shebangs for macOS scripts nowadays, since it's been the default shell on macOS for a little while. That's a niche for sure, but still.
zsh is now the default shell in macOS, so I'd say it's a safe bet if that's what you work with.
careful, there are footguns in those words. It may seem like it's 1-1, but it's not. There are subtle differences especially in escapes. Bash uses \ escapes. Zsh uses % escapes. Zsh has builtin wildcard expansion. There are other differences as well but you can use the emulate command to emulate bash so it actually is 1-1.
Also, once you've made the switch to zsh - checkout oh-my-zsh (https://ohmyz.sh/)
There’s no way I’d go back from Fish to Zsh or Bash on my daily driver. It’s just too pleasant to give up just because of “what if?”.
The big problem is that bash is more or less portable (almost everything has bash in the box). They need to start convincing distros to include and/or default xonsh, to really make it worthwhile.
Once you're already established and comfortable, it's up to you if you want to keep trying the new flavor of the week. People gravitate towards novelty at different parts of the stack: Some people love running FreeBSD or Alpine, but stick to Bash on top of those; others, like me, try to stick with Ubuntu whenever possible, and mess around with things like shells and tiling window managers. Others even return to Windowsland and instead focus all of their efforts on innovating at the highest levels of what they can do with C# and actually making money with an innovative business model.
But you'll never learn where you don't enjoy the thrill of seeing something new break on you if you don't have that initial "question everything" phase.
If I want it on a server I'm using, I (*gasp!*) just install it.
(I still write Bash sometimes and that's not really a problem, either.)
whenever I have some task to deal with data manipulation, i.e. fetch a json, map/filter/reduce on it, save it as some format, I reach for nushell.
If it's just process management or day to day trigger of command in a folder, I use zsh.