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.
GitHub – nushell/nushell: A new type of shell
361–370 of 411 posts
Re: GitHub – nushell/nushell: A new type of shell
#362Earlier 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
Re: GitHub – nushell/nushell: A new type of shell
#363First 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.)
Re: GitHub – nushell/nushell: A new type of shell
#364The inbuilt commands and structured philosophy is a great approach.
Re: GitHub – nushell/nushell: A new type of shell
#365The 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?
Re: GitHub – nushell/nushell: A new type of shell
#366Earlier 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
Re: GitHub – nushell/nushell: A new type of shell
#367Earlier 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
Re: GitHub – nushell/nushell: A new type of shell
#368Earlier 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.
Re: GitHub – nushell/nushell: A new type of shell
#369Earlier 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.
Re: GitHub – nushell/nushell: A new type of shell
#370Earlier 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?
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..