Found while doing forensics on some rediscovered loose flash drives.

You are viewing a single thread.
View all comments View context
2 points

I think I misunderstood you, when you said “manually”, to mean as a human intervention in the process. What you’re showing here is an extra processing step, but I wouldn’t call that manual. Just want to clear that up, but I’m still down to play.

Instead of three greps, you could use one sed or awk. I don’t think there’s anything particularly wizardly about awk, and it would be a lot less cryptic, to me, than this chain of greps.

But a much better idea would be to use sensors -j to get json output, intended for machine reading, and pass that to jq. Since I don’t have the same sensors output as you, I’m not sure exactly what that would be, but I am guessing probably something like:

sensors -j | jq '."nvme-pci-0200".Composite.composite_input'

I look forward to seeing how you would do this in PS. As I said previously, I don’t know it at all, so I’m not sure what you’re comparing this to.

permalink
report
parent
reply
3 points
*

What you’re showing here is an extra processing step, but I wouldn’t call that manual.

Yes, it’s not manual by the dictionary definition, but it is an extra step. This is another meaning of manual in my particular bubble [Edit: that I didn’t think to specify].

But a much better idea would be to use sensors -j to get json output, intended for machine reading, and pass that to jq.

This is my initial point, exactly. Dealing with objects is way easier than using the ‘default’ line-wise processing. Only Powershell made that the default, while in Linux you need to hope that utilities have an option to toggle it on – and then also have jq installed to process the objects.

I look forward to seeing how you would do this in PS. As I said previously, I don’t know it at all, so I’m not sure what you’re comparing this to.

[Edit, since I forgot to answer your main point:] I don’t program in PS. I don’t like the verbosity. But I do think MS has a point in pushing objects as the prime unit in processing instead of lines.

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 6.4K

    Monthly active users

  • 1.5K

    Posts

  • 35K

    Comments