Live data from Hacker News

Nushell.sh ls | where size > 10mb | sort-by modified

nushell.sh

11–20 of 215 posts

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#11
I have nothing but positive things to say about nushell, but I do wish the describe command took a positional argument rather than just being piped into. I was trying to write a pipeline that could give me all the versions from a Cargo.toml and "flatten" any records, but got stuck trying to use describe. Ex:

open Cargo.toml | get dependencies | transpose | rename dep version | each { |row| let version = $row.version; if (describe $version) =~ "record" { $version.version } else { $version } }

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#13
post #2

This has been on HN previously but it's a couple of years later and pleased to see it's still a very active project https://www.nushell.sh/blog/ with good documentation: https://www.nushell.sh/cookbook/

some past HN discussions: - https://news.ycombinator.com/item?id=20783006 - https://news.ycombinator.com/item?id=27525031 - https://news.ycombinator.com/item?id=33419944

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#14
I have been given a link to this when I was describing my ideas of an operating system design, since some of the ideas are similar. However, many ideas are different, since the operating system is in many ways fundamentally different from Windows and from POSIX. Some of these differences may allow such a similar idea to even work better in some ways, possibly.

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#15

Earlier quoted context omitted.

This is written in Rust /s

No, that’s not mentioned as an advantage on the website.

I assume the parent comment did not make fun of nushell advertizing this, but instead about the rust community advertizing itself all the time.

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#16

So, '>' isn't for redirection anymore. How does one do that? open foo.txt | append "world"| save --raw foo.txt Oh.

This reminds me of how Fish handles process substitution without requiring a special syntax.

I love it!

It may seem a bit odd or even cumbersome to experienced shell programmers, but in my experience with Fish, this kind of thing helps a lot with ease of learning.

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#17
post #15

Earlier quoted context omitted.

No, that’s not mentioned as an advantage on the website.

I assume the parent comment did not make fun of nushell advertizing this, but instead about the rust community advertizing itself all the time.

To be honest, they have good reason. Being written in a strongly typed, memory-safe language is a huge advantage. Obviously it's not the primary thing to look out for, but I do prefer tools that are written in it.

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#18

I have nothing but positive things to say about nushell, but I do wish the describe command took a positional argument rather than just being piped into. I was trying to write a pipeline that could give me all the versions from a Cargo.toml and "flatten" any records, but got stuck trying to use describe. Ex: open Cargo.toml | get dependencies | transpose | rename dep version | each { |row| let version = $row.version;…

I would use

open Cargo.toml | get dependencies | transpose | rename dep version | each { |row| if (($row.version | get -i version | default "" ) != "") { $row.version.version } else { $row.version } }

not sure whether that's the best way.

Re: Nushell.sh ls | where size > 10mb | sort-by modified

#20
post #5

What's the advantage of this over PowerShell?

- Better errors - Native support for JSON, etc (no more ConvertFrom-* ConvertTo-*) - Less verbose - Different visualisation

PowerShell isn’t that verbose, compared to NuShell. The ls example would be (with standard PowerShell aliases):

    gci | where { $_.Length -gt (10 * 1024 * 1024) } | sort LastWriteTime
-gt might seem weird, but it’s better than overloading >.

(Also, I like the fact that PowerShell is built into Windows and has a large corporation behind it.)

Post reply on HN