3 ms·
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 filter
by comex 3y ago
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.
- arp242 3y agozsh 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.
- maleldil 3y ago> 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_101/flag.nu https://github.com/nushell/nu_scripts/blob/main/sourced/nu_1...