Live data from Hacker News

GitHub – nushell/nushell: A new type of shell

github.com

361–370 of 411 posts

Re: GitHub – nushell/nushell: A new type of shell

#361

Earlier quoted context omitted.

> You're not really supposed to write scripts for fish Given that 95% of my time in a shell is running a script, a shell that doesn't do that well isn't a great fit for me. > A shebang on the top of your script will invoke the script with the right executable, Assuming the person who wrote it had the foresight to do so. That person isn't always me, and if I have to manually check if each script I run has a shebang, I…

I haven’t seen a shell script in ages that was missing the shebang. Is this common in some places? I’ve started to write dash scripts because that seems to be reasonably posix and bash on macOS is ancient.

Any random blog post that you find with instructions to run something in a shell that uses a variable just won't work copy and pasted, you now need to either modify them for your esoteric shell, or wrap them in a script to be ran through bash

Re: GitHub – nushell/nushell: A new type of shell

#362
post #280

Earlier quoted context omitted.

Xonsh is also my daily driver for years and years. Combined with direnv I have really not missed much of anything from other shells. So much stuff either works out of the box or has some little hacky wrapper to handle it.

Yup. I'm a huge fan of the vox plugin approach to python and venv management. No more virtualenv hacking the shell... it's a first-class citizen. Plays nice with pyenv too

This sounds nice enough that I'm considering installing xonsh just for python development

Re: GitHub – nushell/nushell: A new type of shell

#363
post #300

First 60 second impression - this looks like powershell with not-insane syntax. Looks quite revolutionary, it breaks the traditional paradigm for UNIX shells and appears to artfully refine the good concepts in Powershell (which seem to be let down severely - in my opinion - by UX issues.)

What's wrong with the powershell syntax? The long names? Those are optional. I find the idea of short names (for interactive) AND the option of long names very good. Many of these aliases are similar to unix commands (e.g. "cat" instead of Get-Content or "ls" instead of Get-Childitem).

Re: GitHub – nushell/nushell: A new type of shell

#364
Its not as yet feature complete but has come a long way from its earlier beginnings. I have been using it on Windows and being native and close to UNIX shells really helps my workflow.

The inbuilt commands and structured philosophy is a great approach.

Re: GitHub – nushell/nushell: A new type of shell

#365

The title is somewhat misleading and makes it seem like this is a GitHub company initiative rather than a project just hosted on GitHub. I've not seen this title format on HN before. Could it be changed?

Not only is the place the project is hosted totally irrelevant to discussion, it seems like it would make more sense for this post to link the project website (www.nushell.sh/) instead of the GitHub repo.

Re: GitHub – nushell/nushell: A new type of shell

#366
post #357

Earlier quoted context omitted.

Because parsing text is shit. Good luck AWK'ing everything. Datastreams are simple.

It's often better than trying to figure out the weird formats all the tool would use otherwise

So start outputting something like json. And render it in the console as an ascii table

Re: GitHub – nushell/nushell: A new type of shell

#367
post #327

Earlier quoted context omitted.

> shbang'd to bash. Good. Better: #!/bin/sh Best: #!/bin/sh and also not assuming bash anyway!

Oh and how /bin/bash is bash3 on macOS instead of the contemporary bash5 by default. And how sh is dash on Debian, or Ubuntu, I forgot. Some of the reasons why I would prefer python3 scripts (or perl) over sh or bash

Pretty annoying to reliably #! to python3 as well. Is it /usr/bin/python or python3?

Re: GitHub – nushell/nushell: A new type of shell

#368

Earlier quoted context omitted.

I don’t think I’ve ever seen a script written without the shebang. Btw, you can get around the ancient bash in macOS by installing a more modern bash and invoking with /usr/bin/env bash as your shebang. Not sure if that’s a great idea, mind you, but if you’re already writing scripts in something non-portable, it’s an option.

There are hundreds of sh files on github that don't have a shebang. Just because you don't write them and your colleagues don't doesn't mean they don't exist in the wild.

I didn’t mean to imply that they didn’t exist nor that it might not be important to account for them in some contexts. I meant only to convey my own personal experience: that it had never occurred to me that I might need to account for a missing shebang, since providing an interpreter for a script via shebang is all I have ever personally encountered.

Re: GitHub – nushell/nushell: A new type of shell

#369

Earlier quoted context omitted.

I don't use it as a shell on Linux/macOS (I don't think it's even really supported yet), but as a scripting environment it's been ok: the language is sane enough, you can use the .NET BCL if you need to and its behavior is consistent across platforms. We use it for automation in our .NET codebase (which is being developed on both Windows and Linux) instead of bash scripts because of that and the fact it's preinstalle…

It's supported on Linux. It's one of the first packages I install on a fresh box lately.

What do you use it for generally ?

Re: GitHub – nushell/nushell: A new type of shell

#370
post #102
post #30

Earlier quoted context omitted.

powershell for unix is ... powershell: https://docs.microsoft.com/en-us/powershell/scripting/instal...

Am I missing something cool by not looking into PowerShell for Linux? Anyone using it could chime in and share how it improves their workflow? What kind of tools does it bring to the table?

I don't think so. Although, there seems to be small trend, especially with golang utilities - to shift from text toward json - or rather a "worst of both worlds" - docker is a prime example of this, eg:

  docker network inspect webservers -f '{{ range.Containers}}{{.IPv4Address}}{{end}}'
Once tools start down this path, I think powershell, or any shell built around primitives that work on tree structures, make more sense (ie: rather than cut, awk, grep-tools for printing named fields etc).

Must admit, I am no big fan of ps syntax - too verbose for interactive use - too unfriendly for scripting..

Post reply on HN