Powershell is unfortunately not the shining example of a shell that best leverages structured/typed input/output succinctly.
But on Windows, sysadmins use powershell heavily. Nearly every IT department that manages windows machines uses Powershell.
I don't buy that. On a GNU/Linux box, there's few things that are easier than installing a new shell, if you prefer a different shell than bash it's two commands away. Bash does the job people expect it to do and would probably be _very_ alienated it they'd had to start messing around with .net gubbins.
>And yes I would prefer your second "mental overhead" way as it involves less typing
Maybe for the first time you would. Maybe if you were to accomplish this specific thing. Anything else? Have fun diving into the manpage of your shell _and_ the programs you want to use, and you better hope they share a somewhat common approach to the implemented (object) datatype or well, good luck trying to get them to talk with each other
>Powershell is unfortunately not the shining example of a shell that best leverages structured/typed input/output succinctly
I would just remove the last part, then agree with you: ">Powershell is unfortunately not the shining example of a shell"
> Nearly every IT department that manages windows machines uses Powershell
I mean, what other choice do they have there? cmd? Yeah right, if you want to loose your will to live go for it
When you are SSH'ing into one of 10k containers for a few commands, you will only use what is already there. Bash is there and works and that is what one will use 100% of the time. No one is going to permit Powershell to be bundled to satisfy personal preferences.
This is far more common than you think in enterprise corporations. I work at the hypothetical one, which doesn't use k8s. (yet to upgrade cloud infrastructure of native data center)
If power-shell was bundled by default in Linux distro LTS releases, a lot of sysadmins I know would start using it, since they are already familiar with it for windows and write all their scripts in the same.
1. It doesn't, just use zsh and piping into grep becomes a single character, like so:
alias -g G='|grep -P'
2. Even apart from that I'm a bit sceptical that you can conjure up and type the necessary jq invocation in less time than you can type the fully spelled out grep line.Text gets around that problem, in a sense.
A lot of people have had this thought over the decades, but it hasn't really happened -- powershell exists for linux, but who's using it? The genius of the primitive representation (stringly typed tables) is that it has just enough structure to do interesting processing but not enough to cause significant mental overhead in trying to understand, memorize and reference the structure.
Case in point of the difficulties of adding more structure without wrecking immediacy of manipulation is json.
For anything with more than 1 level of nesting, I do stuff like
probably a lot more than I do because it's just so much less mental overhead -- I don't have to think about indexing into some complex hierarchy and pulling out parts of it.I'm not saying it's not possible to get out of this local optimum, but it appears to be a lot more subtle than many people seem to think. There may be an simple and elegant solution, but it seems it has so far escaped discovery. Almost five decades later, composing pipelines of weakly structured and typed bytes (that, by convention, often are line separated tables, possibly with tab or space seperated columns) is still the only high-level software re-use via composition success story of the whole computing field.