One of the 300+ features of the latest version of OSX caught my eye (do you really think that drivers for a rival OS are a feature of your operating system?). Apparently, OSX is now a fully certified UNIX environment.
Phew. Glad about that. What does it mean, again? Wikipedia explains both the Single UNIX Specification, and the POSIX standards, but to be honest, I'm not too sure how to translate this to the real world. Both specifications should allow for a high level of command line and source code compatibility, but then there's still the need for crazy AutoConf build scripts. At least these systems are now allowed to use the name UNIX (unlike BSD and Linux, surprisingly. They aren't certified).
Anyway. Good for Apple. It's (genuinely) a decent sales feature.
So would it be churlish of me to point out that Windows is a certified UNIX environment? And that it has been since 1998? Probably, but whoa - Windows. UNIX. What? Gosh.
Now this is an easy thing for Apple to do - OSX has always been UNIX-based (based on Mach, which is based on BSD?) But Windows quite clearly isn't UNIX. Or is it?
Well, this is the cool bit. What we're talking about is the POSIX subsystem for Windows NT, and it's one of those really nice little nuggets of technology most people haven't even heard of. Here comes the science.
Windows NT has a nifty feature in its design. As per most OS's it has kernel mode and user mode (where the kernel runs the OS, and user mode runs your programs). But on top of that, Windows NT splits user mode up into environment subsystems.
I can pretty much guarantee that you'll have never noticed this, because the default subsystem is Win32 - what you and I call Windows. Explorer and notepad are win32 applications, as are .net apps. The majority of the dlls on your hard disk are win32 - hence the "win32 API". Win32 even has the killer app - the window manager and the graphics display are part of the win32 subsystem. (Even win16 and DOS - and presumably win64 - are part of this subsystem.)
Windows NT has traditionally supported more subsystems, specifically, POSIX and OS/2. The latter was even going to be the default and primary subsystem, but languished once win32 was chosen. It was apparently only character based, and had no graphical support.
(The Gentoo Linux subsystem turned out to be an April Fool's joke, but the article is still worth a read.)
But the POSIX subsystem is still alive and kicking, and it provides an actual UNIX operating environment, translating the POSIX system calls to Windows NT kernel calls. All the familiar UNIX sights are there - a case sensitive file system (yeah, NTFS supports case sensitivity - purely for POSIX), a root based view of the file system, where everything lives under "/" - /bin, /usr. Your environment startup scripts live in /etc, and you've got access to a bunch of devices under /dev (including /dev/null). And those lovely, familiar, cryptic commands are all present too - ls, vi, grep, awk, sed. It's like a home away from home.
Of course, it's not all a bed of roses. You're now living in a separate subsystem to win32, and you can't call win32 APIs from the POSIX subsystem. And since the user interface lives in win32, you're stuck in that horrible console window (it's not cmd.exe - but it's the same window that cmd.exe uses). There are ways round this, though. And there's some pretty good voodoo to make all of this work as seamlessly as possible. You can run win32 commands from a POSIX app, and vice versa. POSIX apps display in the task manager, and can be killed (handy if you accidentally happen to cat /dev/random, for example. Ahem).
It's had a bit of an interesting history, too. It was originally implemented by Microsoft, apparently just providing enough functionality to satisfy government contracts. Softway Systems managed to get a source license, renamed in OpenNT, then Interix and developed it far enough that Microsoft bought it back and repackaged it as Services for UNIX. And now it's bundled with Vista and known as Subsystem for UNIX Applications.
Rodney Roddick, one of the key developers from the OpenNT days, maintains an Interix website, where you can find a potted history, and a "blog" that includes a slightly more personal remembrance (scroll down to the "10 Years of Interix" entry. There are no links).
I really like this approach to running and porting UNIX programs onto Windows. It has its advantages and disadvantages, but it's one of those lovely ideas that you like even if it's not perfect.