Earlier quoted context omitted.
All four of which users are enjoined, over and over again, not to try to parse the output of (particularly ls). That is, those are the tools specifically not meant to be connected by pipelines, but merely used for operator convenience.
...But how do you extract that data otherwise?
The Rule of Silence (2006)
311–318 of 318 posts
Re: The Rule of Silence (2006)
#312Re: The Rule of Silence (2006)
#313Earlier quoted context omitted.
You can pretty easily pass it to select and get just the properties you care about, or you could output to a different format with the various out- commands. I find it pretty good as a shell.
Options to select output? Sounds like advice from the Rule of Silence. But. - People above were just complaining about having to use sed to tweak output. I don't see why they would prefer a built-in filter to an external one. The external filter is far more flexible, and if that isn't enough, you can replace it. - I'm generally not a fan of applications that tailor their output to what they think the human wants. Unl…
You don't see why someone would prefer 'select' to scraping with grep or awk?
Re: The Rule of Silence (2006)
#314Earlier quoted context omitted.
> The problem is that now simply providing user-friendly output is not enough. For every program or script you throw together you need to provide the text output for the user, and then the type object stream for piping. In PowerShell if the result of a command is just an object the object is pretty-printed to the console in practice ends up looking pretty much like what a Unix command would have given you.
With generic pretty-printing, your program output becomes generic. Compare the output of "df -h" vs the PowerShell equivalent "gdr -psprovider filesystem", for example. One provides the data in dense (easy to follow) rows, while the other spaces it out across the whole screen, leaving large gaps of empty space around some columns while also cutting off data in others. The difference is especially noticeable of you ha…
Get-PSDrive | Where Provider -like '*FileSystem'Re: The Rule of Silence (2006)
#315Re: The Rule of Silence (2006)
#316Earlier quoted context omitted.
You can pretty easily pass it to select and get just the properties you care about, or you could output to a different format with the various out- commands. I find it pretty good as a shell.
Options to select output? Sounds like advice from the Rule of Silence. But. - People above were just complaining about having to use sed to tweak output. I don't see why they would prefer a built-in filter to an external one. The external filter is far more flexible, and if that isn't enough, you can replace it. - I'm generally not a fan of applications that tailor their output to what they think the human wants. Unl…
Re: The Rule of Silence (2006)
#317Earlier quoted context omitted.
Wow, the clipboard is really a thought-provoking comparison. I'm not sure if many people are quite aware of what you said, unless they've done desktop programming: when an application puts something on the clipboard, it can put multiple formats, so that when something else wants to retrieve it, it can use whichever format it prefers. This is how you get such good copy/paste interoperability between programs. What if…
Didn't the Amiga do something like this? (I'm not actually familiar with its OS, I've just seen allusions to how it handled file formats)
Let's say you're MS writing word for the Amiga.
They provide a datatypes description for doc files. this gives ability to read and write the format, and fingerprint it (not based on extension).
Now any program, old or new, that wants to read or write doc files can do. It's just there.
Re: The Rule of Silence (2006)
#318To play devil's advocate, part of the reason things like The Rule of Silence are talked about is because of the messy unix philosophy of treating everything like plain text. If structured data was embraced we would have developed appropriate tooling to interact with it in the way that we prefer. This runs very deep in unix and a lot of people are too "brainwashed" to think of other ways. Instead they develop other ex…
> "Oh but isn't it neat you can pipe it to grep?" NO! No it's not neat, maybe it was neat 20 years ago. Today I want that damn data in a structure. Then you can still print it out in one line and pipe it to grep all you want. The systemd journal works how you describe, and it is very painful to interact with. I'll take plaintext logfiles any day of the week. It's fine if you want to interact with the log in ways that…
Reminding me of one of the little niceties of Gobolinux.
You have a pristine pr version config copy sitting in the main dir, and a package-wide settings dir. It also provides a command (implemented as a shell script, as is most of Gobolinux tools) that gets run upon installing a new package version.
If said command detects a difference between existing and new config files it gives you various options. You can have it retain all the old files, replace them with the new files, or even bring up a merged file that give you the new lines as comments next to the old ones.