If you though writing a bash script can be addictive, wait till you write a nushell script !
The nushell language is clean and quite consistent. It is also much more powerful than bash/fish etc. Don't let the massive number of changes every minor version fool you -- nushell is ready to use. Probably not as a login shell but when you want an "all in one" replacement for the dozens of command line utilities in un*x.
Same. I've had to do tiny tweaks to my scripts when updating recently, but I'll take fixing those 2 lines over trying to maintain a script full of callouts to jq, weird quoting, carefully manually managed dictionaries, etc. Nushell is already amazing for devopsy usage.
Do you mind elaborating on your last point? I'm intrigued by nushell and I'm doing devopsy work, I'll give it a try now but I'd love to hear how you use it and learn from it!
It makes relying on "shell scripts" much easier. Almost entirely gets rid of explicit whitespace handling in variables. Has proper types, so doing some math is safer. Has built-in dictionary / array / tree value support. Has better error handling.
In practice that means gluing together many tools, especially json/yaml/network-related is easier and you have better safety around it all. You can have proper, reusable functions too.
Each script I rewrote from bash to nushell that basically strings together many AWS calls is ~2-3x shorter now and more readable.
Except then you go to share something with others and have to convince people to install your esoteric shell first. It’s the same reason why I quickly abandoned fish - zsh with some fish niceties (auto-complete, etc.) gets me most of the way there, and in the odd case where I’m writing a script and use something zsh-specific, it’s not that hard to convert it to bash if necessary.
as someone else mentioned, the shell you use for interactive work and the language you use for scripting don't have to be the same thing. I use fish as my primary interactive shell( on linux) - but scripts for work stuff will still be bash. That said - nushell is now my primary shell for anything windows related. And I'm aiming to do any minor automation on windows in nu rather than .bat files.
One has to be in a very specific mood to adopt a completely different tool as fundamental as a shell. The required investment and commitment is non-negligible. Even if you can convince people of the advantages, quality itself cannot get them magically over the hump in a day.
You have nushell "the language" and nushell "the shell". You can still use bash, fish, zsh for your day to day shell usage. They are proven, rock-solid and super stable. However, for the kinds of tasks that nushell excels -- gluing together programs, doing simple analysis of the output of text oriented programs etc. nushell can be a viable choice. Here I'm emphasing nushell "the language".
Every language was a niche language once when the user base was almost zero. So I guess it depends on your personality and organization -- are you an early adopter ? Or do you like waiting until the tool/language has established itself ?
I would argue that nushell lets you write powerful scripts like bash. But it can be better than bash because it offers powerful constructs, patterns and primitives. I think nushell is here to stay.
Python is often _too general purpose_. Everything you can do in Nushell you can do in Python except Nushell is just a bit more concise given it is specialized for being a shell language.
Nushell is cool also because it has inbuilt versions of `ls` etc. that output tabular data so it can do all kinds of fancy things with it.
How big of an initial time investment does it require? I.e. if I wanted to try it out on the side from time to time, can I just install and start using it, or does it take a week of learning and writing a configuration before I can properly use it?
More or less a month ago. As of speaking, I'm almost entirely familiar with the standard API, comfortable with the language enough to implement a wrapper around openai with built-in tooling and have a configuration which closely resembles my previous zsh interactive setup.
All and all, after a month of usage, I have no regrets apart from reasonable ones like investing time into what could be categorized as personal delight but the power that lies beneath your fingertips grows exponentially with all of this functionality available out of the box.
Its been a pleasure so far and witnessing its incredible pace makes it even more exciting with pleasant surprises from features introduces waiting in every second corner
Just install, and start using it on the side. It's quite intuitive. Maybe start with the `tutor` command, then go through the guide book: https://www.nushell.sh/book/
you can start using it right away and much of your muscle memory will still give decent results. I say much - since piping with > isn't a thing, but still, it doesn't take long to get used to using it.
The nushell language is clean and quite consistent. It is also much more powerful than bash/fish etc. Don't let the massive number of changes every minor version fool you -- nushell is ready to use. Probably not as a login shell but when you want an "all in one" replacement for the dozens of command line utilities in un*x.