The real solution to this lies in a paradigm shift: see nushell
Bringing the Unix Philosophy to the 21st Century
Submitted 11 months ago by starman@programming.dev to programming@programming.dev
https://blog.kellybrazil.com/2019/11/26/bringing-the-unix-philosophy-to-the-21st-century/
Comments
ishanpage@programming.dev 11 months ago
starman@programming.dev 11 months ago
I actually use both! It’s so nice to just
jc git log
and then work with the data using nushell :)dukk@programming.dev 11 months ago
Oh that’s smart! And then nushell just handles the data for you…I might try that!
lupec@lemm.ee 11 months ago
I’ve always struggled with actually retaining knowledge on how to use the myriad tools you’d need to extract/parse data (awk, sed and friends) and this was a game changer. I don’t quite daily drive it just yet but when I do need it, it’s vastly more ergonomic.
combat_brandonism@hexbear.net 11 months ago
love to read fellow* people in the unix world discovering what made powershell great 10+ years ago as though it’s a paradigm shift. and the top comment of the thread is still nitpicking the points in the post while missing the forest for the trees. I mean
ifconfig
as an example is lol but still.like powershell’s got such bizarre warts and design choices and it’s more ergonomic than unstructured text pipelines despite that
i know it’s not that simple but still, lol
*linux has been my primary os for 9+ years, not throwing stones here
LPThinker@lemmy.world 11 months ago
Nushell is so great! I’ve been using it for a couple years. It has completely replaced my need for tools like grep, sed, awk, etc. and because it handles JSON and so many other data formats natively I rarely even need to think about parsing.
yetAnotherUser@lemmy.ca 11 months ago
Thank you for bringing up nushell, had never heard of it
CubitOom@infosec.pub 11 months ago
I kinda love it in theory.
Will be trying this out.
I do find it funny however that awk is lumped together with these small use case tools like sed, grep, tr, cut, and rev, since awk can be used to replace all of these tools and is it’s own language.
I don’t think the emphasis should be on simplicity, but rather on understandability (which long awk commands are not either).
If you give someone a bash script, they should be able to know exactly what the code will do when they read the script without having to run it or cat out the source it might need to parse. Using ubiquitous tools that many people understand is a good step.
Sadly awk is installed by default in most distros and tools like jq and jc would require installation.
MNByChoice@midwest.social 11 months ago
AWK is fucking awesome!
hallettj@beehaw.org 11 months ago
And there is also Nushell and similar projects. Nushell has a concept with the same purpose as jc where you can install Nushell frontend functions for familiar commands such that the frontends parse output into a structured format, and you also get Nushell auto-completions as part of the package. Some of those frontends are included by default.
As an example if you run
ps
you get output as a Nushell table where you can select columns, filter rows, etc. Or you can run^ps
to bypass the Nushell frontend and get the old output format.Of course the trade-off is that Nushell wants to be your whole shell while jc drops into an existing shell.
dotslashme@infosec.pub 11 months ago
Not to piss on anyones parade here, but grepping something out of a json structure is one of the most asked questions for jq as well. Of course json is nice, but if the goal is to simplify data extraction, I’m not sure much will be gained by this.
As far as reducing the toolchain necessary to extract the same data, this is a welcome addition.
platypus_plumba@lemmy.world 10 months ago
I’ve never been able to successfully write a jq command without having to Google it. It is something so complex and I do it ofter, so I just forget everything I learned.
I hope they figure out something with more I tuitive syntax, something SQL-like that people can write without having to look at a manual.
Anyways, AI is here, so. pretty soon we’ll just translate natural text to whatever overly complex language there is.
I’m sure I’ll get replies of people saying jq is easy. It isn’t for me, right now I can t even remember how to filter and create associations between objects. I think I’ll just start writing small python apps to process JSON. A bit longer but at least I can maintain it. The only issue is that Python is too heavy… I’ll figure something out.