r/programming • • Mar 30 '16

Microsoft is bringing the Bash shell to Windows 10

http://techcrunch.com/2016/03/30/be-very-afraid-hell-has-frozen-over-bash-is-coming-to-windows-10/
5.5k Upvotes

1.2k comments sorted by

View all comments

Show parent comments

23

u/hashhar Mar 30 '16

PowerShell scripts are miles ahead. They provide native XML, JSON support, have API for mananging the entire OS and is OOP and can have iterators, lists, structs etc.

11

u/[deleted] Mar 31 '16

For basic scripting I prefer the text only world of sh. Powershell is nice, but passing around objects makes me feel I might as well just use C#/Python/C++/etc. Though I do prefer it over cmd.

3

u/flipstables Mar 31 '16

I feel the opposite. I really enjoy working with objects at the command line.

0

u/[deleted] Mar 31 '16

[deleted]

1

u/vytah Mar 31 '16

c# or c++, languages without a repl

Ekhm.

Ekhm #2.

23

u/[deleted] Mar 30 '16

You think you can do more from powershell than most of us can from bash? We have utilities for everything and a shitload (probably millions) of open source scripts that can be used from the command line to allow us to handle any sort of data in any way.

24

u/hashhar Mar 30 '16

Well, not to undermine bash, but PowerShell is more spohisticated and self-contained. Sure you can use the amazing open-source scripts to do magic but PowerShell does a lot of it out of the box.

I am a Windows + GNU/Linux guy who has spent fair amount of time in both shells and these are my opinions. I agree I haven't used bash to the extent you may have.

14

u/[deleted] Mar 31 '16

more spohisticated

That's not always a good thing though. PowerShell to some degree feels like over-engineered OOP nonsense

10

u/flipstables Mar 31 '16

It isn't over-engineered really. PowerShell is solving a different problem. In unixland, you work with files & text streams. In Windows, you have to interact with objects (COM and its relatives). It makes sense to use an object-oriented paradigm to script in Windows.

2

u/JohnShaft Mar 31 '16

In Windows, PowerShell is the kitchen sink. It is made to do everything and be self-contained.

In Unix/bash, the shell is the kitchen. All the utilities that can be found at the hardware store can be used. They are all connected by pipes and redirection. Each tool is designed to do a small job, and to do it well.

With Windows, PowerShell gives you a nifty Swiss Army Knife. With bash, the shell gives you a professional toolbox.

1

u/[deleted] Mar 31 '16

The bigger question is how much of that is bash and how much is that calling external applications from bash? Bash, isolated, is rather limited compared to PowerShell.

2

u/jewdai Mar 31 '16

I'd just run a bash script that calls nodejs

0

u/[deleted] Mar 31 '16

[deleted]

1

u/hashhar Mar 31 '16

Good point.

0

u/[deleted] Mar 30 '16

[deleted]

9

u/hashhar Mar 30 '16

Because there is nothing new about this bash. This is just the bash ELF binary running on windows.

1

u/ep1032 Mar 30 '16

for now

1

u/[deleted] Mar 31 '16

hopefully forever

5

u/simspelaaja Mar 30 '16

It's literally just the GNU Bash, straight from Ubuntu's repositories.

2

u/[deleted] Mar 31 '16

The only unfortunate thing is that it's from Ubuntu's repos, so it'll have to be a relatively ancient bash

1

u/CaptainJaXon Mar 31 '16

Surely there will be a way to add other repos though since we can run these things natively.

3

u/[deleted] Mar 30 '16

Because why would they do that when they already have powershell?

1

u/[deleted] Mar 30 '16

To get the best of both worlds.