Goodbye World

October 17, 2011

Another sad day for the computing world – a few days back Dennis Ritchie died. Yes I know I am a bit slow off the mark. This wasn’t a mega-news story like the death of Steve Jobs, but you can find a few news articles  at the BBC, the Guardian, the Telegraph, and Tech Crunch. Of course the public at large knew almost nothing about Ritchie, but he was more important to the creation of the modern world than Jobs. He invented the C programming language and co-created Unix with Ken Thompson. These things underly the Internet, the Mac, the iPhone and Android. There is a straight line from C to Java to C# so even Microsoft is not a Unix-free zone.

I have in front of me my copy of “The C programming language” by Kernighan and Ritchie. One of the many remarkable things is that it is an inch thinner than all my other computing books. It is a paradigm of clarity.

Apparently the news was first broken by Google’s Rob Pike. Here is his very nice follow-on posting on Google Plus.

Rob Pike’s posting and the Tech Crunch article have lots of comments from distressed geeks. Somebody said inventing Unix is like inventing air. I think even folks who hanker after VMS would agree that in practice we all breathe Unix. Ny favourite comment from the Tech Crunch stream was from Mike Church in Malvern, who said :

#include <stdio.h>

int main(int argc, char** argv).
{

fprintf(stdout, “Goodbye World!\n”);.

exit(0);.
}


Ancient VMS vs Unix joke

September 4, 2011

My post yesterday (Unix hair tearing) brought a couple of ageing VMS fans out of the wooodwork. Suddenly I remembered an old joke. Its long enough that I will put it in its own post, rather than in a comment. This joke was going the rounds about eighteen years ago when Starlink switched from VAXes to Unix machines, and suddenly we all had to get used to commands that seemed to be compact but incomprehensible gibberish, such as man, ps, rm, biff, ls, cat, etc…


A young scientist has an urgent job to finish, but disastrously the whole departmental network goes down apart from one ancient VAX. He hears there is an old-timer a few corridors away who still knows how to use the VAX, so he rushes down, bursts in, and insists that the old guy shows him what to do, because, you know, sorry, but this deadline is really important.

“Calm down”, says the old guy, “what do you want to know ?”

“Well, ok, for instance, how do I edit a file ?”

” You type EDIT FILENAME”

“Right, fine, suppose I want to make a copy ?”

“You say COPY FILENAME1 FILENAME2”

“Err, right, ok, now suppose I need to delete the file ?”

“You say DELETE FILENAME”

“Ah, right, right, err.. now what if I want to print it ?”

“You type PRINT FILENAME”

“But what if I just want to see it typed onscreen ?”

“You say TYPE FILENAME”

“What if I need to figure out what a command does ?”

“You say HELP COMMANDNAME”

“Ummm.. umm…. suppose I want to create a new directory ?”

“You use CREATE/DIRECTORY”

“Ok, ok, but look – how the hell am I supposed to remember all that ?”


The list goes on. Check out this comparison table of VMS and Unix commands.


Unix hair tearing

September 3, 2011

I have a Mac because you get nice easy-peasy pretty stuff and proper Unix all in the same machine. Some days when you crack open the terminal you feel a great sense of power and flexibility. Other days you want to strangle the people responsible for Unix. (Anybody for a bring-back-VMS campaign ?)

I use iTerm rather than the Mac-supplied Terminal. It has stopped development, so today I updated to the successor project, imaginatively entitled iTerm2 (strongly recommended – check it out). Suddenly a whole bunch of my alias-ed commands bombed. For example, to check what tunnels I have running I type “tunnels” defined as

alias tunnels=’ps -uaxww | grep ssh’

This gave an error message along the lines of “no such user” whereas when I re-started the old iTerm, it still worked. I narrowed this down to “ps -u” behaving differently in the two apps. In the old iTerm this adds a column to a ps listing which shows the UID owner of processes; in the new iTerm2 the -u switch is for filtering by UID, and so the command expects you to specify that UID. (The regular Mac Terminal behaves the same).

I thought I must be going crazy. In both cases I was simply running a dumb terminal, with the same login command, running the same shell, on the same hardware, running the same version of unix, issuing the same very simple unix command. Wuh ?????

After much hair tearing and some Googling, I found this blog post. It seems that the problem is an environment variable called COMMAND_MODE. When iTerm starts a terminal it sets this to “legacy” whereas iTerm2 and Terminal set it to “unix2003”.

Unix03 is an attempt at Unix standardisation by a body called the Open Group (see here). The other standardisation attempt is POSIX. According to this article no Linux or BSD vendor has achieved full compliance.

So… typical dilemma … do I leave my stuff as it is and set COMMAND_MODE=legacy, or do I try to update my stuff ?

Anyhoo. Sorry for boring you, but ain’t that just bloody typical unix ?


Monday Miscellany

June 2, 2008

(1) Having just got a Macbook, I am getting back into Unix. Got Unix in a Nutshell to brush up. Hmm. How can anything 906 pages long be “in a nutshell” ?

(1b) There must be a joke in there somewhere about kernels and shells and so on. Err… never mind.

(1c) Or possibly a Hamlet-ish sort of joke ? King of infinite space and all that ?

(2) The consultation panel reports are all done and dusted. But you can’t see ’em yet. Soon.

(2b) PPAN and Science Board have met. No leaks. A few days ago the STFC website had a news item called Update from Science Board. It has to be the dullest news item ever. “Hem. We had a meeting. It was a meeting of the Science Board. The meeting that took place was a meeting that was one of the Science Board. At this meeting, Science Board matters were discussed. Discussions that took place were discussions that pertained to the business of the Science Board. The Board had such discussions, and such discussions were had. By the Science Board. At a meeting. This meeting was one of a series of Science Board meetings.”

(2c) News from Council on July 1st will be vastly more gripping.

(3) I can tell nothing exciting has happened recently, as my stats are down by a factor of several. Honestly, a chap writes deep stuff about Mars and Religion and so on, but all you want is the dirt on STFC.

(4) The other day, the Head of College introduced me to a Very Senior Figure from the BBSRC. This chap from BBSRC said he knew perfectly well who I was, as he reads my blog regularly. Crikey. Errr but.. said I .. you are not an astronomer or even a Physicist ? No, said he, but we read it to find out whats going on at STFC. Blimey. I tried to explain it shouldn’t be taken as authoritative information, just personal opinion, and a space for the usual suspects to let off steam.

(4b) This sort of thing must p*** off STFC staffers, seeing distorted and unreliable information filtering through the blogosphere. Apparently they have decided that if ye cannae beat ’em, ye join ’em. A wee birdie tells me that Richard Wade has started an internal blog especially for STFC staff.

(4c) I have not seen the new blog, as it is only an internal thing for STFC staff. And no I can’t give you the URL. Even if I was naughty enough to want to do so, I can’t because it ain’t that simple. It seems that to read Wadey’s blog you have to follow a six step registration process.

(5) Err … that’s it.