open Cargo.toml | get dependencies | transpose | rename dep version | each { |row| let version = $row.version; if (describe $version) =~ "record" { $version.version } else { $version } }
Nushell.sh ls | where size > 10mb | sort-by modified
11–20 of 215 posts
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#12Re: Nushell.sh ls | where size > 10mb | sort-by modified
#13This 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/
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#14Re: Nushell.sh ls | where size > 10mb | sort-by modified
#15Re: Nushell.sh ls | where size > 10mb | sort-by modified
#16So, '>' isn't for redirection anymore. How does one do that? open foo.txt | append "world"| save --raw foo.txt Oh.
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
#17Earlier 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.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#18I 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;…
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
#19Re: Nushell.sh ls | where size > 10mb | sort-by modified
#20What's the advantage of this over PowerShell?
- Better errors - Native support for JSON, etc (no more ConvertFrom-* ConvertTo-*) - Less verbose - Different visualisation
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.)