Re:Linux Namespaces Are a Poor Man's Plan 9 Namespaces
by pcwalton on Wednesday June 21, 2023 @01:46AM
(#36414832)
I agree with you to some extent, but the solution is fd: change the tool's interface to make simple things easy. Deleting the tool entirely does nobody any favors. As bad as find(1) is for simple stuff, piping du(1) to grep(1) is worse.
[ Parent
| on HN ]
Re:Linux Namespaces Are a Poor Man's Plan 9 Namespaces
by comex on Wednesday June 21, 2023 @03:01AM
(#36415306)
That's half of the solution. The other half, I'm convinced, will be a tool that makes complex things possible. After all, if I really need some complex filtering, find's primitive logical operators probably wouldn't even be sufficient. To that end, I love how Nushell's leading example on their home page is
ls | where size > 10mb | sort-by modified
It seems so elegant! Down with strings! …But it's not my life yet, since last time I wanted to try Nushell they didn't have scripting yet, and I have yet to circle back around to it. There's also Elvish and PowerShell and Oil Shell but they all have their own issues.
Re:Linux Namespaces Are a Poor Man's Plan 9 Namespaces
by arp242 on Wednesday June 21, 2023 @05:04AM
(#36416166)
zsh solves this with globbing qualifiers:
ls -t *(Lm+10)
"L" for the "file size" qualifier (why "L"? For "less than size", I think – probably because "s" is already used for setuid), "m" for megabytes, "+" for "larger than". You can also add "om" or "Om" to sort by mtime, but ls will reorder it so you need the -t flag (or the -U flag to not sort things).The syntax is not easy, even byzantine, but it's a lot less to type and pretty convenient in interactive shells.
Re:Linux Namespaces Are a Poor Man's Plan 9 Namespaces
by maleldil on Wednesday June 21, 2023 @07:44AM
(#36417239)
> Nushell they didn't have scripting yet
If you mean you couldn't run batch scripts from a file, they can do that now. There's an example repo with some community scripts. My favourite is how they handle CLI parsing: https://github.com/nushell/nu_scripts/blob/main/sourced/nu_1...