4 ms·
And on Windows there is something better than Bash, called PowerShell.
by NiveaGeForce 8y ago
And on Windows there is something better than Bash, called PowerShell.
- Already__Taken 8y agoWhich actually supports linux with PS 6.0+
- NiveaGeForce 8y agoIndeed.
- dijit 8y agoUnless you want secure strings.. then it complains about "Crypt32.dll" not being available.
- mauvehaus 8y agoOr want to pipe data without PowerShell mangling it[0] PowerShell is materially worse than bash for a great many purposes because of this design choice alone. [0] https://brianreiter.org/2010/01/29/powershells-object-pipeline-corrupts-piped-binary-data/ https://brianreiter.org/2010/01/29/powershells-object-pipeli...
- MattSteelblade 8y agoThe particular example this user complains about is piping binary data to file. It makes use of the Out-File cmdlet which is making (by default) Windows based assumptions as to how to encode this content. They would have been better served by using cURL's native -O parameter. To say that the pipe corrupts it is another thing entirely.
- chrisfinazzo 8y agoNot to put too fine a point on it, but that's nonsense. Historically, PowerShell was supposed to be a replacement for cmd.exe and roughly equivalent to bash, yet suitable for the Windows environment. They tried early on to port some of the UNIX & Linux tools to Windows and it didn't fly, so this is what we're left with. Although parts of Powershell are open source now, I suspect the mere existence of WSL means that Microsoft understands it has more to gain from compatibility with the rest of the world (Bash is nigh-everywhere) than imposing their particular philosophy on people. (See also, Apple's decision to adopt UNIX underpinnings) I'm prepared to be wrong if PowerShell actually gets used outside of Windows, but I wouldn't bet on it.
- NiveaGeForce 8y ago> Not to put too fine a point on it, but that's nonsense. In PowerShell you pass structured data around instead of globs of text, which is much more maintainable. Using Bash on Windows is like going backwards, and it's sad that most developers don't even realize it. > Historically, PowerShell was supposed to be a replacement for cmd.exe and roughly equivalent to bash, yet suitable for the Windows environment. They tried early on to port some of the UNIX & Linux tools to Windows and it didn't fly, so this is what we're left with. Nonsense, Powershell is a fundamental improvement. It's not a "this is what's we're left with" situation. > Although parts of Powershell are open source now, I suspect the mere existence of WSL means that Microsoft understands it has more to gain from compatibility with the rest of the world (Bash is nigh-everywhere) than imposing their particular philosophy on people. Yeah, let's just drag everything down to the lowest common denominator. > (See also, Apple's decision to adopt UNIX underpinnings) Which is sad, since it could have been so much more. The Unix way of doing things, isn't the be all and all. https://www.youtube.com/watch?v=rmsIZUuBoQs https://www.youtube.com/watch?v=rmsIZUuBoQs https://news.ycombinator.com/item?id=16813796 https://news.ycombinator.com/item?id=16813796
- gerrard00 8y agoI used Powershell extensively before I ever had experience with a linux or unix shell. I still have more experience with Powershell than bash or zsh, but I can't imaging going back. I'm already much more capable in a *nix shell. There are advantages to having a pipe based on structured data, but that also means you have to know what structure to expect at ever step of the way and whether or not other tools can work with that structure. There are also tons of little quirks about Powershell; enough so that I eventually just started writing most stuff in C# and then just using the Powershell scripts as glue. Passing text means that every single one of the thousands and thousands of unix cli tools that accept stdio will work in your pipeline. I think this industry needs to get away from the terrible/horrible, absolute thinking. Most tools have positive and negative
- protomyth 8y agoPassing text means that every single one of the thousands and thousands of unix cli tools that accept stdio will work in your pipeline. It also means every one of those thousands and thousands of Unix clip tools needs to have a parser to turn that text into some sort of structure to operate on.
- ladzoppelin 8y agoIts too verbose for me and I would rather use Python or Bash. WSL is amazing for these things.
- AnIdiotOnTheNet 8y agoIt has aliases. Both built in and user definable. In fact, there are default aliases that match many of the utilities you're used to. You might know that if you'd spent more than 30 seconds with it before shouting "it's not bash!".
- stinos 8y agoI'm a huge PS fan and like to stay as far away as possible from Bash but still, I wouldn't call it better than Bash. At least not always and everywhere. More like different. Both come with a list of advantages and disadvantages. And once you learnt one, the list of disadvantages of the other probably seems too big to even start with it, at least that's what it is now for me.