Live data from Hacker News

PowerShell vs. Unix shells

stackoverflow.com

71–80 of 84 posts

Re: PowerShell vs. Unix shells

#71
post #69
post #5

PowerShell compared to Cygwin bash, in my experience: * Powershell is more capable than bash, straight up. * bash is easier to use; writing ad-hoc pipes etc. in PowerShell has never seemed pleasant to me, the commands are verbose and the contractions non-obvious; getting help is tedious, and options are often very long. * Object orientation works well when you're dealing with meaningful objects. But often you just wa…

I think this is basically right. PowerShell is what you'd get if you started writing "the perfect shell" from scratch. But comparing to bash in isolation is sort of missing the point. Everything in unix is designed to work in the shell, and that's not true in windows. So you have tools like ssh and nc and curl at hand, designed to feed each other via pipes and do one thing well. Want to push a file to a server behind…

Copying files is an excellent issue: at some point I suggested either on the PowerShell blog or their feedback site that PowerShell should have the ability to copy files via remoting (essentially what you mention, you can remote into a box via powershell and need to copy a file from your local machine onto the remote box).

The response I got from someone at MS was quite telling, it went something like "please tell me more why you would ever want to do this, when we have existing folder sharing technology in windows". I gave up, if they seriously don't understand why that is NOT the answer to situation, gee...

Re: PowerShell vs. Unix shells

#73

"closed as not constructive by Bobby, Kev♦ 20 mins ago" This despite 111 upvotes on the question, 249 upvotes on the accepted answer, and 43 upvotes on the HN link (0 mins ago). ---- Dear Stack Overflow Moderators, Seriously, what is it that you find to be so objectionable about interesting topics? Love, bunderbunder

There is no plausible objective answer to this question, thus its not for StackOverflow. If you want to just talk about interesting topics, use a forum (so says the SO masters).

The problem is, a lot of smart people are on SO. I ant them to answer my non-objectively answerable, flamy question. I don't want a 16-year old script wiz to talk about differences between PowerShell and Unix Shell. And I want other visitors to be able to vote what they think is the better answer.

The only other forum I know that kinda matches this criteria is HN, which is far from ideal (it doesn't show you the votes, it usually doesn't show up in search, the discussions are active for less than 2 days and if you come here late, you won't be able to participate).

Looks like I want the same thing as StackOverlow, with a few minor differences... So, why not create another StackExchange forum (they already have 600 or so) JUST for these kinds of questions?

P.S: programmers.sta... is almost as bad as SO, regarding these kinds of questions.

Re: PowerShell vs. Unix shells

#74
post #36

Earlier quoted context omitted.

> PowerShell is still treated as a second class citizen in the Windows eco-system This is so completely wrong it's not funny. The majority of Microsoft's server GUIs are now built completely on PowerShell. This includes basic products like IIS, Exchange, etc. Where I work, most consultants who implement or maintain these products have learned PowerShell and use it regularly. Windows Server 2012's default option is "h…

Interesting - babarock is incredibly wrong from the windows perspective, but from the unix perspective entirely correct. (I work in IT and handle things on both sides.) Comparatively, the recent and steadily increasing reliance on PS is evidence of microsoft's recognition of the utility of a shell for managing their more complex software. On the other hand, the fact that PS doesn't have it's own readline yet (it's ju…

Have you used PowerShell ISE 3.0? Its user experience is better than the standard tools on *nix that I've used, and of course much better than the old powershell. You get very good autocompletion (similar to what you get in IDEs like Eclipse or Visual Studio), syntax highlighting, debugger, etc.

Re: PowerShell vs. Unix shells

#75
post #74
post #36

Earlier quoted context omitted.

Interesting - babarock is incredibly wrong from the windows perspective, but from the unix perspective entirely correct. (I work in IT and handle things on both sides.) Comparatively, the recent and steadily increasing reliance on PS is evidence of microsoft's recognition of the utility of a shell for managing their more complex software. On the other hand, the fact that PS doesn't have it's own readline yet (it's ju…

Have you used PowerShell ISE 3.0? Its user experience is better than the standard tools on *nix that I've used, and of course much better than the old powershell. You get very good autocompletion (similar to what you get in IDEs like Eclipse or Visual Studio), syntax highlighting, debugger, etc.

But you can't use things like git from ISE because it doesn't support interactive console apps...

Re: PowerShell vs. Unix shells

#76
post #63
post #48

Earlier quoted context omitted.

I fail to realize why any of these features were "important problems" of Unix shells. Passing byte streams between programs is a very powerful idea and transfers the responsibility of interpreting what the input is to the program parsing it. I realize, from a programmatic point of view, that being able to get a series of objects and to invoke a specific method on them is an intriguing idea, but it breaks the simplici…

a) I fail to realize why any of these features were "important problems" of Unix shells. b) Passing byte streams between programs is a very powerful idea and transfers the responsibility of interpreting what the input is to the program parsing it. b) is an important problem. It means that there are zillions of implementations of various parsers. That inefficiency costs money. Worse, not all of them are without bugs.…

> It means that there are zillions of implementations of various parsers. That inefficiency costs money.

Most of them (if you are referring to command-line utilities) are open-source. I see this variety of implementations as a good thing - evolution relies on diversity and the openness makes it possible for software to "reproduce sexually", making evolution easier.

Re: PowerShell vs. Unix shells

#77
post #65
post #50

Earlier quoted context omitted.

Please, "like you can with the Bourne shell". Scripts that assume you have bash make baby Jesus cry.

Only if baby Jesus is using an open source BSD. Bash is standard on all Linux and OS X installs, and vastly more featureful than the POSIX sh standard. If you're a decent bash hacker and really in a situation where you can't rely on a better scripting runtime to be installed, you'd have to think really hard about whether FreeBSD/OpenBSD is worth the hassle. Honestly, the BSDs need to get their act together on this an…

Possibly they could make zsh the default interactive shell, bash is GPL. If you need a better scripting runtime python is probably a better bet.

Re: PowerShell vs. Unix shells

#78
post #70

Earlier quoted context omitted.

I know Android is Linux based, and, for background, I'm an experienced Linux user/developer, but have never checked out Android as a Linux till now, though I've heard that phones can be rooted. So my q is: what all can you do with bash on Android - as compared to bash on a desktop or server Linux? Interested to know because I have an Android phone. Do you get all or some of the Linux command-line commands like awk, s…

The base install is very minimal, but you can install a functional environment: https://play.google.com/store/apps/details?id=com.zpwebsites... I wouldn't like to run Eclipse on it, but I guess Emacs would run with ease.

Thanks for the reply.

Re: PowerShell vs. Unix shells

#79
post #77
post #65

Earlier quoted context omitted.

Only if baby Jesus is using an open source BSD. Bash is standard on all Linux and OS X installs, and vastly more featureful than the POSIX sh standard. If you're a decent bash hacker and really in a situation where you can't rely on a better scripting runtime to be installed, you'd have to think really hard about whether FreeBSD/OpenBSD is worth the hassle. Honestly, the BSDs need to get their act together on this an…

Possibly they could make zsh the default interactive shell, bash is GPL. If you need a better scripting runtime python is probably a better bet.

It depends on what you're scripting, some things really are expressed best in the shell.

But tools like perl, python and ruby aren't nearly as universal as you'd like them to be. Obviously if you maintain the box and are deploying an app, they're trivially available. But if you're shipping software to be installed on end user boxes of unknown configuration, they're a dependency that can bite you. That's why things like self-extracting archives and shell-based initscripts persist, even though they look ugly to modern eyes. They do what they need to do very well, and they do it universally.

Re: PowerShell vs. Unix shells

#80
post #61
post #36

Earlier quoted context omitted.

Interesting - babarock is incredibly wrong from the windows perspective, but from the unix perspective entirely correct. (I work in IT and handle things on both sides.) Comparatively, the recent and steadily increasing reliance on PS is evidence of microsoft's recognition of the utility of a shell for managing their more complex software. On the other hand, the fact that PS doesn't have it's own readline yet (it's ju…

just try managing AD users in PowerShell - sure its easy once you've written your own custom script or mapped it to a web interface or something, but there's no built in equivalent for adduser or about a billion other basic UNIX commands It's not that bad. Adding a new AD user is a built-in command. From the docs: New-ADUser GlenJohn -OtherAttributes @{title="director";mail="glenjohn@fabrikam.com"} I'm not a UNIX adm…

me@my_server$ useradd -G director glenjohn

glenjohn@my_server$ vi .forward

:a

glenjohn@fabrikam.com

:wq

And there are at least a few other ways to do that. But you certainly don't have to be an admin to specify an alternate email address.

Post reply on HN