News for hackers. Stuff that matters.
Re:Linux-flavored Windows by drzaiusapelord on Tuesday November 26, 2013 @10:42AM (#6801933)
This is a weird article. It ignores powershell entirely and I really disagree about cygwin being this bloaty and difficult thing to install. If you just want basic unix utilities then cygwin is a breeze to install and use.

On top of it, you can download compilations of standard gnu unix untils at sourceforge compiled for windows. I have a standard unixutils folder on the c: root of the drive of all my computers so I can easily access stuff like wget, netcat, grep, etc. Works well enough.

Re:Linux-flavored Windows by eamann on Tuesday November 26, 2013 @10:48AM (#6801968)
Scripting in Powershell is nothing like scripting in Bash. I like and use Powershell on a daily basis - but can't re-use my PS scripts on a Mac because the shells are nothing alike. The point was to achieve OS parity.

For a newcomer, no, Cygwin is not a breeze to install and use. The documentation is abysmal, the download takes forever (unless you know ahead of time which tools to install and which to omit), knowing which packages to install to enable specific features is impossible for someone without experience, and there is no native uninstaller.

Re:Linux-flavored Windows by drzaiusapelord on Tuesday November 26, 2013 @11:11AM (#6802152)
Why is this person even bothering to use windows instead of running a unixy desktop plus wine or Windows in a VM? For your requirements, its asinine to buy a windows box. If you're working in windows, might as well spend 20 minutes learning the basics of powershell. Not sure why this is a controversial suggestion. Leave windows if its all too bothersome.
Re:Linux-flavored Windows by cgh on Tuesday November 26, 2013 @11:37AM (#6802351)
This is directly addressed in the article. He is a .Net developer.
Re:Linux-flavored Windows by csmuk on Tuesday November 26, 2013 @01:29PM (#6803136)
So am I for pay cheque reasons.

For the sake of sanity though, I use Linux with a windows VM.

Re:Linux-flavored Windows by jiggy2011 on Tuesday November 26, 2013 @11:45AM (#6802409)
Sometimes you also need programs that don't have good Linux versions and bad Wine support. I tend to find GUI heavy applications are a pain to use in a VM.
Re:Linux-flavored Windows by csmuk on Tuesday November 26, 2013 @11:14AM (#6802167)
Agree, apart from PowerShell which is a bastardised mutant crawling snail spawn of satan. It's like using a VAX 11/780 over a 300bps dialup. SMS messages have a higher throughput.

This is almost entirely because it uses the CLR which has terrible inefficiency due to immutable strings, the CLR startup time and insane cost of reflection.

Re:Linux-flavored Windows by nailer on Tuesday November 26, 2013 @11:45AM (#6802403)
> the CLR which has terrible inefficiency due to immutable strings, the CLR startup time and insane cost of reflection

That's true, PowerShell is slower than bash. It does more, and that has a cost.

That said: it's by far the best designed shell in terms of syntax, and actually separating presentation from logic.

Eg, print me a list of processes started in the last hour (from memory, I don't normally use Windows)

    ps | ? StartTime -gt $1HourAgo | kill
Notice the lack of silly things like creating regexs to represent time?

Unix shells are MS Word. Powershell is LaTeX.

Re:Linux-flavored Windows by ajross on Tuesday November 26, 2013 @01:28PM (#6803128)
This isn't an issue of shell syntax, you're pointing out that the ps tool emits structured output which can be queried in standard ways by downstream filters. Which is great, as a user feature.

Now explain how to write a "ps-like" command which emits mostly the same stuff and coexists in the same universe. Now things flip: unix is straightforward and easy (everyone understands how to emit text, and you can do it from literally every programming environment there is) and windows is arcane and inscrutable, and works only with whatever .NET framework understands that log stream.

Fast forward a few decades, and examine the size of the ecosystems built around "simple tools and text streams" vs. "custom logging format plus cute syntax".

It's a forest for the trees argument. Microsoft, as always, optimized for the wrong part of the problem. In this case: the admin experience is great, at the expense of the developers of the tools those admins would need to run.

Re:Linux-flavored Windows by nailer on Tuesday November 26, 2013 @03:44PM (#6804073)
> Which is great, as a user feature.

Yes, exactly.

There are far, far more users than complementors (tool creators) in this space. Optimising for users is excellent, and smart tool creators will see and appreciate the benefits.

Re:Linux-flavored Windows by ajross on Wednesday November 27, 2013 @01:13AM (#6806738)
Except they don't, as witnessed by this thread. Powershell is a ghost town. No one uses it, because there are no meaningful tools that use it. With ssh and rsync and git and bash and whatnot, I can script up a remote deployment or replication system for a simple task in a few hours. To extend your ps example, I can throw in a little awk or perl and spit out a clean report of suspected memory hogs.

Where is the powershell ecosystem? It doesn't have one, sorry. Syntax can only take you so far, and as I pointed out Powershell designed for syntactic power at the expense of extensibility. And it made the wrong choice.

Re:Linux-flavored Windows by nailer on Wednesday November 27, 2013 @05:36AM (#6807438)
> Powershell designed for syntactic power at the expense of extensibility. And it made the wrong choice.

A decent syntax is orthogonal to extensibility: Powershell uses .net because Microsoft likes .net. A Python, Ruby or node-based equivalent wouldn't use .net, and still have a clean syntax.

Re:Linux-flavored Windows by csmuk on Tuesday November 26, 2013 @01:27PM (#6803126)
Absolutely not. It's terrible. Some more reasons to hate it:

1. It can throw a message box or prompt on the screen without any notice. Precisely how this is handled from a scheduled task is "interesting".

2. If you're non US locale, you get different date formats pop out of get-date, gci and CLR DateTime. This at some points in time scares the living fuck out of me as an implicit cast to string can swap day/month around.

3. Changes every year or two. Features features features. Gotta learn them all. Pokemon time.

4. Module system is a piece of shit.

5. Signing is so friction inducing that everyone just turns it off to get shit done.

you compare to bash here. Bash doesn't do much at all. This is the point. It leverages other tools to do the work. In your example you mention regex for parsing dates. This is a bad approach. "date +%s" returns sortable integers which you should work with.

PowerShell is Word. LaTeX is a felt tip. Bash is a fountain pen and a steady hand.

Re:Linux-flavored Windows by nailer on Tuesday November 26, 2013 @03:49PM (#6804098)
Totally agreed re: module system and interactivity. As I mentioned, it's only in terms of syntax I think Powershell is excellent.

> "date +%s" returns sortable integers which you should work with.

Date returns text, not integers. Your shell doesn't understand that there are not more than 60 seconds in a minute.

You might argue that people shouldn't use a shell to parse dates, and pass the text onto a proper tool to read it. That doesn't change the fact that Unix admins, like Perl developers, try and do this all the time. Maybe the best thing about posh it stops people from doing stupid things.

The LaTeX/Word analogy was simple: powershell separates content from presentation. bash does not.

Re:Linux-flavored Windows by angersock on Tuesday November 26, 2013 @12:36PM (#6802767)
And look at all the people who use LaTeX!

(This is pretty much a textbook example of the New Jersey worse-is-better style...fitting, since it involves Unix directly.)

Re:Linux-flavored Windows by runjake on Tuesday November 26, 2013 @11:47AM (#6802426)
It's not a weird article at all. And from what you posted, you didn't even read it.

The author mentioned in the very beginning of the article that they wanted something that would work cleanly across their other (*NIX) platforms. Powershell, while fantastic, is not cross-platform.

And Cygwin does some funny stuff that also makes client configuration a bit of extra work if you're, again, dealing with multiple platforms.

Re:Linux-flavored Windows by joemi on Tuesday November 26, 2013 @12:05PM (#6802562)
To be pedantic, the article mentions that he's using "the Windows command line", and not Bash. So Powershell's non-cross-platformness does not seem to be breaking his goals any more than that.
Re:Linux-flavored Windows by lucb1e on Tuesday November 26, 2013 @12:16PM (#6802636)
(I haven't read the article yet) What, it doesn't recommend bash but the default Windows shell? That's really weird, bash makes the shell by itself 10 times more versatile, regardless of what commands are available.

Edit:

> using a text-only interface is extremely foreign.

Oh I see, he's newb (as in the normal meaning of the word, not mocking). That explains.

Re:Linux-flavored Windows by runjake on Tuesday November 26, 2013 @12:10PM (#6802590)
To be further pedantic, the article is about maintain a relatively-close command line environment between Windows, Linux, and OS X. The parent commenter failed to notice this.
Re:Linux-flavored Windows by mmagin on Tuesday November 26, 2013 @01:33PM (#6803168)
For me, what's horrible about Cygwin is that a lot of things that perform just fine on a normal Unix are horribly slow. Just try running an Autoconf "configure" script sometime. I'm told this is because emulating fork() is very expensive in Windows (in contrast to the Unix model where it's very cheap.)