Earlier quoted context omitted.
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.
There are plenty of strongly typed memory safe languages. In fact I think those are the majority of popular languages.
Nushell.sh ls | where size > 10mb | sort-by modified
81–90 of 215 posts
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#82Earlier 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…
Get-ChildItem | Where-Object { $_.Length -gt 10MB } | Sort-Object LastWriteTime `
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#83I'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…
When I show people the same advantage that PowerShell has over bash I pick harder problems where bash/gnu tools have no trivial answers. But then people get sour grapes and say “I don’t need to do that kind of thing anyway.” The reality of course is they avoid those harder problems and solve them manually or with different tools (Python).
Sorting is as good example, because while commands like ‘ps’ have some built in sorting capability, it is limited and inconsistent with other tools. You can sort by some columns, but not others. Sorting by the same field is often a different option across different tools even if they manipulate the same objects, etc…
If you would like a harder problem: kill every process on the machine run by the user “ash” that has used more than 1 hour of total CPU time but only those of his processes that are in the top 5 in the entire system by memory usage.
Hint: Don’t kill anyone else’s processes by accident even if their user name is “flash” or if their process name is “bash”. Also don’t confuse instantaneous %CPU with total CPU usage.
Did I say total CPU? Oops, I meant total kernel time used! My mistake. Update your a script, that should be a simple change… right?
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#84I'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…
I think this tool is useful for people who need to use the terminal right now, without having to spend quite a bit of time learning, e.g., Bash. Your point about the portability of Bash is, of course, valid. It just that sometimes you need to get stuff done quickly without parsing, at times unfriendly, documentation of more mature tools.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#85I 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 have, a few! But they are the kind of dev to never publish their work anywhere, not even little shell scripts. Secretive windows power users
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#86Earlier quoted context omitted.
I don't mind the looks but I find it hard to debug and have a poor instinct for "does this need a curly bracket or a parens?" That's my real issue with PowerShell, I find it very hard to predict what will work unless I know exactly what the rule is. Shell has similar issues but I've put 20 years into it so the knowledge is there. Every time the PowerShell people describe PowerShell I think "that sounds awesome" but t…
Blocks always use braces. Expressions use parentheses for grouping sub-expressions. It's the same as many C-like languages. I can't imagine any situation where you would be confused which one you need to use.
If I spent all day as a PowerShell dev I'm sure I would know it, but for something I reach for once or twice a year intuitiveness is a feature I would like to have.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#87I'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…
Dozens of specific commands and flags for specific usecases aren't always enough, and, dare I say it, counter to the UNIX philosophy.
Re: Nushell.sh ls | where size > 10mb | sort-by modified
#88Re: Nushell.sh ls | where size > 10mb | sort-by modified
#89I'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
#90I 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