I'd better spend my time writing a different shell. This sounds like a life-long with ever increasing number of bugs nightmare to support kind of project.
I'd better spend my time writing a different shell. This sounds like a life-long with ever increasing number of bugs nightmare to support kind of project.
It would give me tools like sed/grep/awk/tr/cut/etc., and allow easy capturing of output into variables and performing bash substitutions. IMHO, that's much more powerful than PowerShell's Select-String.
The big difference is that you don't have to use them for every goddamned command.
Really? What are the equivalents?
Also, you can use linux tools in PowerShell, but that is not the point, it is back to stone age moment.
Shell scripts shouldn't be other name for text parsing.
You cannot use linux tools in PowerShell in most cases, since they aren't installed by default.
> Shell scripts shouldn't be other name for text parsing.
That may be true, but like any other ideal - it's just that, and ideal. In the real world a lot of shell scripting requires parsing unstructured text from various command outputs and files. PowerShell works great in its own microcosm of objects and commands that manipulate objects, but as soon as you step out of that comfort zone it becomes awkward to use.
> You cannot use linux tools in PowerShell in most cases, since they aren't installed by default.
The same as jq and specific variants of tools you mention. Not like you can't install them in single line: winget/choco install awk,grep,jq,less...
> In the real world a lot of shell scripting requires parsing unstructured text from various command outputs and files.
No it doesn't. I do shell scripting for more then decade in PowerShell and I can count how many times I parsed the text. The most used one is simple split like with `$paths = $Env:PATH -split ';|:'`, but other then that no. I used select-string only couple of times in decade, on all OSes.
> but as soon as you step out of that comfort zone it becomes awkward to use.
That is true for literary anything. Actually pwsh does great with 'native' tools too, and there is even MS module to help with "native app wrapping". See [1] and [2]
Today its more or less regular to have json output which can be trivially read by pwsh ConvertFrom-Json
[1] https://devblogs.microsoft.com/powershell/native-commands-in....
[2] https://redmondmag.com/articles/2020/12/11/powershell-cresce...
I really couldn't care less about plain text. It doesn't bother me. What PoverShell "gives me" is another spoonful of sugar in my already sweet tee. It's really unnecessary / would just make my life more miserable.
That is funny and shows tremendous lack of understading of shell complexity. Perhaps your own OS next ?
Another thought I have is re-designing the work with processes and their output in the way similar to Erlang's ports. I'm not sure this can be done in all instances, but I would definitely give it a try.
There are other minor evils, like return vs exit that needs to be solved... but, I really don't have a plan for making my own shell, so all the above is just based on particular pain points I had with it over the years, so, I don't really plan on making my own shell. But, equally, and even more so, I have absolutely no intention to use PowerShell, especially because I'd have to maintain hundreds of unrelated pieces of code, each with its own versioning history and a huge compatibility matrix. That just sounds like insanely boring and unproductive way to spend my life.