Earlier quoted context omitted.
For some reason I never liked to do it the "right way". First of all it doesn't seem to actually matter. But most of all the cat way just aligns with my mental model more. Data flows left to right, if you catch my drift. It also makes it easier to add arguments to the end if re-running it.
>But most of all the cat way just aligns with my mental model more. Data flows left to right, if you catch my drift. Using ` out_file` (Though annoyingly this doesn't work for feeding input to while loops. `< <(echo a; echo b; echo c;) while read -r foo; do echo "$foo"; done` is invalid syntax; it needs to be `while read -r foo; do echo "$foo"; done < <(echo a; echo b; echo c;)`)
Nushell.sh ls | where size > 10mb | sort-by modified
181–190 of 215 posts
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#182Earlier quoted context omitted.
This is the same reason I eventually learned and stuck with Vi(m). Implementing a project on a massive array of SPARC Solaris boxes and every "easy' tool I'd learned just... wasn't there. I had kind of learned Vi at that point, but wasn't remotely proficient in it, and had only gotten as far as I had due to a bunch of cool plugins I'd installed that definitely weren't available.
That last part is often forgotten. I usually stick with defaults (or as close as I reasonably can) not because they are functionally better but because for most things I don't have the return on learning and regularly using two instances of ${tool} isn't worth the extra time. Sometimes it's a pain but it seems to pay off.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#183Earlier quoted context omitted.
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.)
The fact PowerShell has this masochistic tendency to have commands that start with capital case already makes it outside of the realm of consideration for me. It's absolute nonsense. Also I have to say your example is extremely confusing and would probably take quite a bit of time to write IRL. For reference, the equivalent in sh would be: find . -maxdepth 1 -type f -size +10M -exec ls -lt {} + Or a very terse exampl…
It's not the best language for anything, but working a Windows shop, I'd rather bang stuff out in PS than grind my way through Visual Studio/C# for simple tasks.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#184My problem with alternative shells (anything not bash) is that I have to learn bash anyway, and if I want to use a scripting language that requires me to first install a runtime, drop into it, doesn't work on colleagues machines, etc. then there are many non-shell alternatives that are better. I'll learn nushell or whatever once a mainstream or somehow desirable distro ships with it as their default shell.
> I have to learn bash anyway Do you? You need bash installed, certainly, but you don't need to learn bash in order to merely execute bash scripts. To use an analogy, just because your distro scripts things in Python doesn't mean one needs to learn Python to use the distro. I basically never need to write or read a bash scripts these days (I use fish, but I rarely write a real fish script either; just learn the langu…
It's a bit like the equivalent vim argument. Yes, using unmodified vim means you have access to the same tools in every environment. But I spend 99% of my time in one environment, so I'd like to optimise for that one, whether that's by using an IDE or installing a bunch of vim plugins and customising everything. Then when I do need to SSH into a server somewhere, I can get by on the bare minimum - in my case, usually nano. If I'm using nano for long enough that I start missing my IDEA features, then I've been using nano for too long and need to figure out a different way of deploying/debugging changes in the first place.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#185I'm sure there's a lot more once you get to more advanced stuff, but going through their System examples has me puzzled: > ls | where type == dir or in Bash: `ls -d` > ps | where cpu > 0 | sort-by cpu | reverse or in Bash: `htop` ? > ps | where name == Notepad2.exe > # find process, then ... > ps | where name == Notepad2.exe | get pid.0 | kill -9 $in or in Bash: `pkill Notepad2.exe` > Pipeline content to clipboard Or…
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#186Earlier quoted context omitted.
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…
Very interesting! Do you transmit this metadata on a different fd, like 3? (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?
At the moment there is POC code to transmit over fd 3 but I’m looking into using UNIX sockets instead.
> Super cool. Since it's Go, does that mean runtime errors will silently fail and keep chugging along? /dig ;)
This project predates Rust 1.0 so it was a no brainier at the time to use Go. But actually I do think Go is well suited for this type of problem because much as some complain about errors being regular types, the way Go encourages granular handling of errors rather than larger try / catch blocks or exceptions does lead to more tailored error messages. Which ultimately helps explain the problem better for the end user.
Not taking anything away from Rust or any other language. Nor am I saying Go’s error handling doesn’t have its problems. Just that I’d probably choose Go again if I were to start this project tomorrow.
> Can you customize the PS1?
Every part of the shell is customisable. However rather than having hard to discover environmental variables that can alter the shells behaviour, instead there is a command called config that allows you to inspect every option.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#187My problem with alternative shells (anything not bash) is that I have to learn bash anyway, and if I want to use a scripting language that requires me to first install a runtime, drop into it, doesn't work on colleagues machines, etc. then there are many non-shell alternatives that are better. I'll learn nushell or whatever once a mainstream or somehow desirable distro ships with it as their default shell.
This is the same reason I eventually learned and stuck with Vi(m). Implementing a project on a massive array of SPARC Solaris boxes and every "easy' tool I'd learned just... wasn't there. I had kind of learned Vi at that point, but wasn't remotely proficient in it, and had only gotten as far as I had due to a bunch of cool plugins I'd installed that definitely weren't available.
> First and foremost, Nu is cross-platform. Commands and techniques should work across platforms and Nu has first-class support for Windows, macOS, and Linux.
Source: GitHub. No snark intended.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#188Earlier quoted context omitted.
I'm not really sure which other popular languages would be considered memory safe AND strongly typed. I know of both C and C++ which I wouldn't consider memory safe. And I know of Javascript, which is not strongly typed... so which do you mean?
Java, Scala, Kotlin, C#, D, Go, and TypeScript to name a few.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#189My problem with alternative shells (anything not bash) is that I have to learn bash anyway, and if I want to use a scripting language that requires me to first install a runtime, drop into it, doesn't work on colleagues machines, etc. then there are many non-shell alternatives that are better. I'll learn nushell or whatever once a mainstream or somehow desirable distro ships with it as their default shell.
This is the same reason I eventually learned and stuck with Vi(m). Implementing a project on a massive array of SPARC Solaris boxes and every "easy' tool I'd learned just... wasn't there. I had kind of learned Vi at that point, but wasn't remotely proficient in it, and had only gotten as far as I had due to a bunch of cool plugins I'd installed that definitely weren't available.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#190Earlier quoted context omitted.
The fact PowerShell has this masochistic tendency to have commands that start with capital case already makes it outside of the realm of consideration for me. It's absolute nonsense. Also I have to say your example is extremely confusing and would probably take quite a bit of time to write IRL. For reference, the equivalent in sh would be: find . -maxdepth 1 -type f -size +10M -exec ls -lt {} + Or a very terse exampl…
Get-Old -Fast