Wednesday, March 16, 2011

Unix commands in bash

I've been using Macs for around two years or so now, having previous experience with Linux and Unix. I've seen references to OS X being based on BSD, but I can't get basic commands to work from the shell ('make', for example). I have installed Xcode but it hasn't helped. Any advice how to use the standard Unix commands from the OS X terminal?
I'm currently using OS X 10.6.6 on 2.1GHz Intel core 2 duo Macbook.

Reply 1 : Unix commands in bash

You're probably going to need Darwinports installed to get some of the GNU developer tools installed on Mac OS X. And I'm reasonably certain they won't be able to build the .app collections that make up your standard Mac OS X type app, they'll just be your more standard Linux/Unix bin and lib files. Which would probably be fine for text based apps, but if you want to build GUI based apps, they'll have to use the X11 interface that is an optional install. You want a native OS X app, Xcode is the path of least resistance by far.

Just a bit of background. The core OS of Mac OS X, known as Darwin, is an offshoot of FreeBSD. It is open source, and you can actually download a distribution of just Darwin if you want. Apple also regularly imports code from FreeBSD, and contributes back large chunks of modified code. The GUI on Mac OS X, known as Aqua, is NOT open source and is obviously the main selling point of the entire OS. It is based largely on the NeXTStep GUI which Apple acquired probably around 11-12 years ago, and the Cocoa API used on Mac OS X is really a continuation of the OpenStep API used by projects like GNUStep. There still does exist an alternate API known as Carbon, which is based on the old Mac OS Classic API, but I believe as of 10.6 it is officially depreciated, and will likely disappear with 10.8 or 10.9.

Also, it should be noted that Objective-C is by far and away the language of choice on Mac OS X. It is the native language of the Cocoa API. I honestly do not know if there are bindings for other languages or not, I haven't really kept up on that. There PROBABLY are, but they're also probably second class citizens. Java support is going away in 10.7 which is due out in early summer, and the OpenJDK people will have to get their act in gear before then if there's going to be any Java support. Of course if you were a Java developer, you probably wouldn't be caring about something such as make.

Reply 2 : Unix commands in bash

Thanks for the info Jimmy, looks like I need to persevere with Xcode.

No comments:

Post a Comment