Why doesn’t Mac update standard UNIX utilities?

I am currently teaching a course on programming for linguists. We are using python, but for the first few classes, I have been going over some standard UNIX utilities like cd, ls and such, plus using regular expressions with grep and sed. I actually don’t use sed that much. I tend to reach for perl, since I know it better, and it can do pretty much all the same stuff that sed can plus much more. But sed is simpler than perl, and I basically just wanted to use it for doing substitutions.

Today I got an e-mail from a student asking why the following did not seem to be working:

echo abcd123 | sed 's/\([a-z]*\).*/\U\1/'

The student reported the following output: “Uabcd”. (The expected output is “ABCD”, which is what I get on Linux)

I tried it, and it worked fine for me. Then I thought: maybe this is a Mac/Linux problem. Sure enough, when I look at the man page for my Fedora 7 box, it tells me that my version of sed is GNU 4.1.5, from June 2006. Mac Leopard (10.5) is using BSD sed from July 2004. Leopard came out in 2007, as did Fedora 7. Why is it 2 years behind? Why is it still using python 2.4? Why doesn’t it come with useful utilities like dos2unix? Mac has done a great job of making a nice GUI, with some pretty cool applications like iLife. It is falling behind when it comes to the command line utilities though.

This entry was posted in linguistics, linux, mac osx, perl and tagged , , , . Bookmark the permalink.

One Response to Why doesn’t Mac update standard UNIX utilities?

  1. Bernhard says:

    Well, you’ll probably get the same BSD sed with a(nother) BSD system like FreeBSD, OpenBSD etc. – from a BSD point of view, it will be up to date. You *can* install GNU sed via macports (and probably fink). But as the BSD people enjoy repeating: ‘GNU is not UNIX’, i.e. the reprogrammed and extended ‘standard’ GNU UNIX programmes have (often helpful) additions incompatible with their forebears. (However, Max OS X like [other] BSDs ships some GNU programmes, such as *g*awk.)