Hacker News new | ask | show | jobs
by SiVal 4965 days ago
For most of Microsoft's lifetime, I've wondered why MS didn't just build a unix-style command line into Windows, providing a major upgrade to the ridiculous DOS. As a Windows dev, I always downloaded unix utilities for DOS and the first thing I put on any new Windows box is Cygwin. After decades of the same ol' DOS, it's obvious that MS just doesn't care about the command line.

One reason I switched to Mac for Web dev is the tightly integrated unix command line. I love it, but I don't think Apple does. I don't think the integrated unix CLI is any emblem of enlightenment on Apple's part; it's a historical accident. A company that believes that even granting users a "files and folders" view is giving them too much power (iOS) is no stalwart defender of the command line interface. As we make the Windows -> Metro, Mac -> iOS shift, the time may come when any command line access to a commercial OS is part of a "developer tools" package available only to "registered" developers who have "signed zee papers."

I've only used Linux servers for years. I wonder if I'll end up a few short years from now with some sort of hackers' Android laptop, built with Apple-quality hardware/software integration by somebody like Samsung for the niche of people who want real computers instead of media purchasing appliances.

1 comments

Seriously, MS has been going toward easy scripting for years:

http://en.wikipedia.org/wiki/Windows_PowerShell

And Powershell ISE is like bash with Intellisense.

You can access .Net from Powershell and pretty much do anything you want. You can easily write new commands in C#.

Everything you want is already there. You just have to step slightly out of the Unix mindset to find the Windows equivalent. And I'd have to say that the powershell idea of passing objects around instead of text is exceptionally useful.

Whats an object? Some type of file?
I can best explain via example. Let's say I want to iterate through a directory and do something to each file:

  ls C:\ | foreach{echo $_.Name}
That will print out the file name. The $_ variable represents each file object that ls returns. Let's say I want the file creation times instead:

  ls C:\ | foreach{echo $_.CreationTime}
Or just the day of the week the file was created:

  ls C:\ | foreach{echo $_.CreationTime.DayOfWeek}
It's incredibly powerful. And the default is always a text representation of the object anyway, so it seems like text is getting piped, just like Unix. If you do this:

  ls C:\ | foreach{echo $_}
You get a typical directory listing.