Live data from Hacker News

GitHub – nushell/nushell: A new type of shell

github.com

391–400 of 411 posts

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

#391

Earlier quoted context omitted.

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 ?

My default shell. Everything from manipulating XML to system administration. I'm a big fan of the object-based pipeline.

Quick examples:

- Accelerators for data and conversion tasks. For example, reading a file with `Get-Content` (or frequently in the shell, the alias `gc`) and parsing and converting into a traversable, queryable XML: `[xml]$myXml = gc my-file.xml`. Then you can go `$myXml.customers.firstName` or use an XPath query.

- To get the difference between two dates, `[DateTime]::Now - [DateTime]'2021-01-01'` returns a `TimeSpan` with the elapsed hours, days, etc. It parses the date string for you because of the `[DateTime]` before it.

- The cmdlets for system administration. For example, exporting processes that use more than 200 MB of RAM and their image paths to CSV: `Get-Process | where { $_.WorkingSet -gt 200000000 } | select ProcessName, Path | Export-Csv memory-hogs.csv`

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

#392
post #327

Earlier quoted context omitted.

Yup. There are more shells than there are IDEs, keyboard switch types, keyboard layouts, and operating systems. Shell ideological wars get just as bad as emacs/vim and linux/Mac. Use whatever you want, but company IP is shbang'd to bash.

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

Best would actually be

#!/usr/bin/env sh

Since this binary is required by the POSIX standard to exist at that location.

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

#393

Earlier quoted context omitted.

Do you have some specific examples? E.g. ripgrep is packaged on most operating systems I have used, along with exa, and a few other Rust utils I use. I certainly do not use Cargo to install them.

Perhaps the packagers on your platform went that extra mile to build binary packages. Taking a quick look, the Homebrew formula[0] for ripgrep on macOS just lists a dependency on Cargo (rust) and then seems to invoke the cargo command for installation. I'm not well versed in Ruby though, so my interpretation could be wrong. I don't want to come off as entitled, either. I know the Homebrew folks are doing a ton of bri…

If it installs a bottle, then does it still require installing Rust? If so, then maybe that's a shortcoming of Homebrew.

Either way, it kinda seems like you're complaining about Homebrew here. Not Rust.

If having Cargo/Rust on your system is really a Hard No (...why?), then I guess find a package manager that only delivers whatever is necessary, or, if available, use the project's binary releases: https://github.com/BurntSushi/ripgrep/releases/tag/13.0.0

And actually, in the case of ripgrep, it provides a Homebrew tap that specifically uses the GitHub release binary: https://github.com/BurntSushi/ripgrep/blob/master/pkg/brew/r...

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

#394
post #107

Thinking this is so cool! I was wondering if seriously buying into an alternate shell like this would be worth it in the long run. Would really love to read from people who use(d) an alternative shell, both success and failure stories. I cannot shake from my head the idea that buying into a non-standard shell will only work for personal projects in one's own workstation, but it won't fly too far for company work beca…

You might be interested in chubots comments as he regularly responds to questions related to oilshell:

https://news.ycombinator.com/threads?id=chubot

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

#395
post #376

Earlier quoted context omitted.

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.

wait how does the OS even invoke an interpreter without a shebang? If you have to explicitly call an interpreter when you invoke it, then it's no extra work to call bash some_script.sh anyway

As I’ve learned in response to this thread, apparently some (but not all) Unixy OSes will run a file marked as executable using /bin/sh if no shebang is supplied.

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

#396
post #341

Earlier quoted context omitted.

> x = 0 doesn't work Maybe it's just me, but I love how the assignment syntax can be used just for a single command: 'MANPAGER=cat man' is a lot nicer than '(MANPAGER = cat; man)'. > and x=$y is a security flaw When is variable assignment a security flaw?

if $y is untrusted input then you need to quote it or you've introduced shell injection attack to the script.

You don't need to quote variables on the right hand side of an assignment.

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

#397
post #152

Earlier quoted context omitted.

use it as an interactive shell first, not for shell scripts. also, why would any dependency of your projects at work be implicit? all dependencies should be captured somehow, the very least in some documentation. at our company, we use shell.nix files to declare all of our dependencies, so everyone has the exact same software available on their development workstations. it's not a completely trivial thing to do, but…

> also, why would any dependency of your projects at work be implicit? all dependencies should be captured somehow, the very least in some documentation. .... Nix. Because distributing software is hard, especially if things change. That's one big reason why Docker images will sometimes get used for development environments (like what VSCode supports). Nix is nice, and is a pretty good way of capturing those dependenc…

I understand that the industry largely does not acknowledge how big of a problem implicit dependencies are, but since the OP is clearly aware of some issues with implicit dependencies, I was just surprised why so content with these issues. It clearly hinders the adoption of upcoming technologies at least in the mind of the OP.

I'm not really an expert in the Nix expression language. Hasn't even finished reading the Nix pills, which is a very practical documentation, yet I could manage to extract a lot of benefit from that shell.nix template I've shared. I'm using Nix for 3+ years now. Because of this experience I do encourage others not to be afraid trying Nix. It gets better with every release.

Docker is a halfway solution and because of its memory and storage requirements it often strains the average development workstations and internet connections.

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

#399
post #65

Earlier quoted context omitted.

This is insanity and hubris. "It's so easy!" yes if you have the language and tools de jour installed and up to date. I want none of that. It was node and npm. Then go. Now Rust and cargo. Oh, I forgot ruby. And all this needs to be up to date or things break. (And if you do update them then things you are actively using will break.) I don't need more tamagochis, in fact the less I have, the better. What happened to…

Many of the popular rust cli tools like ripgrep, exa, delta, etc -do- have package manager install options. How dare people writing cli tools not package them conveniently for my distro. The horror of using cargo instead of cloning the source and praying make/meson/etc works. Feel free to package and maintain these tools yourself for your distro if you want.

I don't know about you, but in my experience, getting Cargo to work has been a much bigger pain than make/meson et al.

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

#400

Earlier quoted context omitted.

Many of the popular rust cli tools like ripgrep, exa, delta, etc -do- have package manager install options. How dare people writing cli tools not package them conveniently for my distro. The horror of using cargo instead of cloning the source and praying make/meson/etc works. Feel free to package and maintain these tools yourself for your distro if you want.

I don't know about you, but in my experience, getting Cargo to work has been a much bigger pain than make/meson et al.

I've never had any issues with cargo. I use rustup to manage my rust toolchains and cargo for the most part.
Post reply on HN