Unix hair tearing

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 ?

Advertisements

29 Responses to Unix hair tearing

  1. Tony says:

    Oh, I remember the day I joined DEC and first worked on a VAX after a few years on PDPs. VMS was the *best*.

  2. andyxl says:

    And I thought P.Helbig would be the first to join the campaign…

  3. Tony says:

    And also just remembered someone explaining the difference between DEC and IBM. In IBM systems, you cannot do anything unless someone lets you. With DEC systems, you can do anything unless someone stops you. The latter was my approach to most things so DEC really suited me (not that the corporation ran wholly the same way).

  4. telescoper says:

    The first computer I ever used for serious programming was the VAX they had at British Gas; I worked at the Online Inspection Centre between A-levels and going to University, writing software for a pipeline analysis system. I have to say that I found them a joy to use, especially the ability to use DCL scripts to perform lengthy operations.

    More importantly you could type things like DIRE/SIN=YES…

  5. […] post yesterday (Unix hair tearing) brought a couple of ageing VMS fans out of the wooodwork. Suddenly I remembered an old joke. Its […]

  6. Aye. In our Starlink terminal room we used to get up at half past three in’t morning just before we went to bed t’ut beat theorists onto running batch jobs on’t vaxes f’t data processing *because* we were astronomers (and had no remote network connection and the pubs in Embra didn’t shut till then). But we were ‘appy!

    Part of the affection for all things VMS is because we often used to spend the night with them?

  7. Despite the fact that a VAX was the first “real” computer that I ever used, I do not feel any such nostalgic pangs – In fact I remember the feeling of enlightenment and power that that the appearance of the first Suns at Jodrell brought with them in comparison to the clunky old VAXen.

    We still have some mission critical VAXen at Jodrell – though hopefully not for too much longer….

    • Tony says:

      I contracted at Esso Research a long time back. Met up with a guy from there years later and had my ego well stroked when he said they’d upgraded the site to VAX but kept one PDP just to run a program I’d written 🙂

    • Don’t compare apples and oranges. When I came to Jodrell, I bought my own VMS machine. At the time, it was the fastest workstation in the world, and had much better compilers than the SUNs. Despite real differences (and ALPHA was almost always a leader in its day), new kit is generally faster than old kit.

      I went to Jodrell Bank 15 years ago. They had moved to unix workstations but still had VMS for the important stuff. I remember thinking at the time that that would still be true in 15 years.

  8. Tony says:

    Rather higher geek:boffin ratio on this post than usual 😉

  9. John Peacock says:

    Andy: it isn’t fair to stir up memories of the long-lost paradise of VMS. It’s interesting how worldlines diverge. DEC could have killed unix stone dead if they’d had the sense to licence VMS cheaply for any hardware – but they didn’t, and they lost out to something much less nice to use, but infinitely cheaper. A few years ago, I used to think that Apple had made the same blunder, and were going to be eclipsed by the awfulness of MS windows. But somehow that didn’t happen, and now you might bet on the long-term extinction of MS. I wonder why we got different outcomes in those cases?

    If any unix fans wonder what the fuss over VMS is all about, consider the almost telepathic way you could use wildcards in file handling. You have a directory containing data_1 to data_1000, and you realise the stuff is superceded but still worth keeping. Simple: type RENAME data* data_old* and your 1000 files are called data_old_1 to data_old_1000. I still miss this flexibility.

    • Sun made the same mistake as DEC as they has Solaris on x86 working but refused to market it (presumably from fear of cannibalising lucrative SPARC sales) when MS only had Windows 3.1 to offer.

      DEC, Sun and Apple had the huge advantage that they produced the hardware and the software, so you got a working computer out of the box. Despite their hardware disadvantage MS were successful because they had control of the software that allowed people to do the work they had to – i.e. Word/Excel – actually to end users the OS was largely irrelevant, although for the manufacturers it is very important as it is the platform to be able to create this software, and provides the “lock-in” (So DEC and Sun were foolish not to take the opportunities to propagate)

      Apple, probably by good fortune (because they were not getting anywhere in the traditional computer market) decided to try a new device- the IPod – they learnt from MS in that they just made it easy for ordinary people (not geeks) to do what they wanted, and in doing so they created fantastic lock-in (via iTunes). Based on this success they realised that they could actually propagate their OS in a new simple computer – the IPhone/IPad….

      Without the IDevices, Apple would have gone the same way as Sun – The only sad thing is that the OS developments from the IDevices are being fed back into the standard computers, which seems like a retrograde step for the geeks….

      • John Peacock says:

        Paul: I agree with your last comment. Almost all astronomers seem to have MacBooks because we like the flexibility of unix under the hood (OK, really it’s because they are shiny…). I look on with horror at the contrasted utterly locked-down world of the iPad, and wonder how long it will be before Apple does the same to its laptops. Having been the plucky underdog for so long, Apple now start to look awfully fascist. You can see it creeping in in little things – e.g. finder won’t open the iPhoto library even though it’s just a set of files; and you have to use iPhoto to access your digital camera even though it’s just a memory stick with a lens attached, and should appear in finder. At the moment, the MacBooks are just about perfect: mostly you can do it the Apple way, or do it the way you want to. But I’ve a feeling the latter will get harder and harder, and we may look back on the flexibility of 2010 with the same nostalgia that VMS now promotes. Or to put it more concisely: MacBook=VMS, iPad=unix.

      • andyxl says:

        John – I was fearful of Lion for the reasons you state, but I quite like it now. Its easier for Mums but they haven’t locked out the flexibility – yet… If they do, it will be time to switch to Linux I guess.

        Does your Mac have an SD slot ? You can just put your camera card in that and it appears as a volume, so you can just drag across the files and use whatever imaging app you like. I use CocoviewX and sometimes XNViewMP

      • MatthewH says:

        John: the iPhoto library is now a package. To open it in finder ctrl-click (or two finger tap?) and select “Show Package Contents”. IIRC the default behaviour for attached cameras is hidden in Image Capture, with the camera attached open Image Capture and you should be able to define the default behaviour.

  10. andyxl says:

    Paul – excellent stuff except

    “they learnt from MS in that they just made it easy for ordinary people (not geeks) to do what they wanted”

    To be fair to Apple, this is what they already did in 1984 with the original Mac. I remember sitting my Mum in front a Mac and she understood it quickly, when no other computer had ever made sense to her. It took MS about ten years to catch up.

    I think MS actually owe their dominance to IBM. It was the PC that captured the world really, and MS came in on its coat tails. Although Apple had been making “personal computers” since the 70s, when the IBM PC came out, lots of hardware companies reverse engineered it and made cheap clones. MS very cleverly captured the software-supplier market to that cheap hardware success. Who would buy an expensive Apple when a cheapo PC can do the simple things you need ?

    Then as you say, it all changed with a groovy new personal gadget. I think the key thing here is that (ordinary) people buying gadgets behave differently to company buyers supplying the office.

    • Hi Andy – you are right of course Apple had been making the OS easy to use for years – what I was trying to express – but failed -is that what they learnt from the MS success was that it was the applications (what you actually did with the computer) not the OS that really tied the ordinary user in. In the iPod case this was getting music onto the device – they pretty much abstracted away the idea that the music existed as files on the OS – so the ordinary consumer does not need care about the OS as long as it provides a way to click on the App icon….

  11. “(Anybody for a bring-back-VMS campaign ?)”

    No need to bring it back when it never went away. Yes, it dropped out of academia, in part due to bad marketing on the part of DEC but mainly because grown men, astronomers, professors, even knights of the realm allowed their sysadmins to dictate what OS they use. (Remember, when your unix sysadmin mentions security, he is talking about his own job.) Outside of academia, much of the world runs on VMS. At his blog, Sean Carroll mentioned he is planning to learn Python because he can’t get Fortran to work on his Mac. I never thought I’d live to see the end of the world, but now that it is here, I didn’t expect it to be this bad!

    A while back I posted some comments in this thread on your blog. As appropriate as ever. Check them out!

    In particular, check out this old Starlink Bulletin. Scroll down to page 7 for Captain Starlink.

  12. I think the fact that most of the comments are about VMS—and they are good comments about VMS—while it was mentioned only in a throwaway parenthetical remark in a post about Apple and unix pretty much sums things up. 🙂

    By the way, I’m happy to give you oppressed boffins an account on my VMS cluster if you ask. The VMS you remember from way back then was better than unix is now. Modern VMS is even better.

    What’s the advantage of having tenure if you can’t get VMS on your desktop?

  13. I know this is off-topic but maybe I’ll get a response here. I would
    really like a separate RSS feed for comments. Many of my favourite
    blogs have them. Especially on a blog with many comments like this one,
    one needs some method of following new comments which is better than
    looking at (in theory) all old posts.

    If I just can’t find it, someone point me to it. If there isn’t one, why not?

    Also, can you have a link to the previous and next posts at the top and/or bottom of each post?

    • Yes, thanks!

      I’m surprised that some blogs with many comments, like Cosmic Variance, don’t have this (or at least I haven’t found it). Ideally would be to show not all unread comments, but rather the first unread one in a given post (though this would make sense only for non-threaded comments).

  14. When I get a spare moment from AGP stuff, I will try to add the right buttons…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: