Earlier quoted context omitted.
ls is an alias for Get-ChildItem in Powershell as well, btw
Only on Windows. On Linux it's the original `ls`. Same for `cat` and many other commands. That's why using `gci` / `gc` is safer if you want your script to work everywhere. https://learn.microsoft.com/en-us/powershell/scripting/whats...
Nushell.sh ls | where size > 10mb | sort-by modified
151–160 of 215 posts
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#152Earlier quoted context omitted.
Besides it's also a fail-safe way to make sure the program doesn't modify the original file. random-app ./myfile.txt The app opens the file on its own. It could decide to write to it. cat ./myfile.txt | random-app The app receives chunks of the file from a pipe. It doesn't know where the original file is. This is especially useful if you aren't sure the program will by default modify the file (such as formatters).
Yeah but you get the same from random-app
$ echo foo > a.txt
$ /proc/self/fd/0 )
$ cat a.txt
barRe: Nushell.sh ls | where size > 10mb | sort-by modified
#153I like the idea of piping structured data between processes instead of streams of bytes, but that's what PowerShell is for. I don't think I've ever met another dev who likes PowerShell
> I don't think I've ever met another dev who likes PowerShell I have. But they have never used bash, zsh, Fish, or NuShell.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#154Earlier quoted context omitted.
I'd actually like the ability to do either raw bytes (traditional) or structured bytes (the NuShell/PowerShell idea) in an "opt-in" scenario. This would also allow a smoother transition/lack of needing to fully commit right off the bat. I've considered writing wrappers for standard utilities in Bash/Zsh that accept and output structured data in JSON (or maybe a denser serialization format that can easily convert to J…
This is similar to how my shell works. It still just passes bytes around but additionally passes information about how those bytes could be interpreted. A schema if you will. So it works as cleanly with POSIX / GNU / et al tools as it does with fancy JSON, YAML, CSV and other document formats. It basically sits somewhere between Powershell and Bash: typed pipelines like Powershell but without sacrificing familiarity…
(reading more) Super cool. Since it's Go, does that mean runtime errors will silently fail and keep chugging along? /dig ;)
Can you customize the PS1?
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#155Earlier quoted context omitted.
> What if someone starts from a clean slate. Which shell is better? Then they learn the better and end up having to learn bash anyway coz that's what runs on remote machines. There is also not that much to be gained. Common easy tasks might be easier to learn but just few percent faster in the end. Harder ones are faster by one-off script in "real" programming language most of the time. Harder repeatable one should n…
> coz that's what runs on remote machines Is that actually still an issue these days with Docker containers and what not? How often do you access a remote server via SSH where you share an account with your colleagues and cannot install another shell next to bash? (So that bash could still be the default but you could switch on the fly.)
Also, I've sometimes had to work on remote boxes on an internal-only network, with no outside internet access. In that case installing anything new is even more of a pain, so it's easier to work with the defaults as much as possible.
That said, I'm all for learning new tools. Progress couldn't be made if everybody just stuck with the old. But there's always a trade-off to be made between time investment into new tools vs. just getting your work done with the old ones.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#156What's the story with not having a deb / flatpak / appimage or snap distribution? Just lack of resources to help package?
Don't think we've had any requests for those, but we'd welcome contributions if someone wants to make it happen. For now, Homebrew works if you want a cross-distro way to install Nu on x64 Linux.
I'm not likely to use brew on Linux (rather stow/xstow if I have to).
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#157Earlier quoted context omitted.
"This thing I don't understand reminds me of another thing I don't understand, so it's bad I decided."
[flagged]
I think your snark is unfounded here.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#158Earlier quoted context omitted.
Hm. Why not re-use "tee"? https://www.man7.org/linux/man-pages/man1/tee.1.html
`save` seems to be a general serialization command, which lets you save Nu objects in formats like JSON, YAML, and others. The `--raw` option seems like a convenience for enabling that tee-like usage without relying on external programs, but the driving use case is serializing structured data rather than unstructured text or byte streams.
I think this might hit the sweetspot for me, for dealing with json - I never could get a feel for "jq" like I have with sed/awk, and don't much enjoy powershell.
I don't think I need a new shell (bash is fine - and I would probably move to fish for a new shell if I were to change) - but I certainly need a sane way to wrangle json (hello docker inspect!) and yaml (hello kubectl/k8s and github actions!).
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#159Earlier quoted context omitted.
Only on Windows. On Linux it's the original `ls`. Same for `cat` and many other commands. That's why using `gci` / `gc` is safer if you want your script to work everywhere. https://learn.microsoft.com/en-us/powershell/scripting/whats...
Aliases can be redefined in certain situations (such as compiling a LCM configuration into a MOF for use with PowerShell DSC). The only safe way to script is to use the full command names (Verb-Noun).
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#160Earlier quoted context omitted.
Yeah but you get the same from random-app
Only if random-app is well-behaved (and if you knew it was you could just use `random-app ./myfile.txt`). $ echo foo > a.txt $ /proc/self/fd/0 ) $ cat a.txt bar