Mar 31 2007

Are you receiv­ing syn­tax errors when run­ning a shell script on Ubuntu 6.10 (Edgy Eft)? If so, you might want to check what shell you are using. While test­ing scripts for the LCA A/​V Team a few months ago, I dis­covered that the Ubuntu developers decided to sym­link /​bin/​sh to dash, for faster and less memory-​​intensive script exe­cu­tion. For POSIX-​​compliant scripts, this isn’t a prob­lem at all. How­ever, there are many third-​​party scripts which call /​bin/​sh but use shell-​​specific (typ­ic­ally bash) syn­tax. They can be fixed by alter­ing their first line to call the most appro­pri­ate shell, for example:

#!/usr/bin/env bash

env makes it pos­sible to call bash, wherever it may lie. While my Ubuntu and Gentoo sys­tems have a /​bin/​bash, there are other dis­tri­bu­tions which have /​usr/​bin/​bash or /usr/local/bin.bash.

While you can and should fix your own scripts to oper­ate in this way, con­stantly mend­ing oth­ers’ mis­takes can become tire­some. You can return your /​bin/​sh to point to bash with the fol­low­ing command:

$ sudo dpkg-reconfigure dash

When asked if you wish to install dash as /​bin/​sh, tell it to go to hell emoticon

Note that bash does use more memory, but on a mod­ern desktop machine the dif­fer­ence is neg­li­gible. This change will not affect the default login shell, since that is already bash.

 

LotD:  Obese Aus­sies get big ambulances

Mar 20 2007

I have been com­pletely floored by Ubuntu’s new Migra­tion Assist­ant. It’s cer­tainly some­thing that we have needed in the FLOSS world for a long time. Any­thing we can do to reduce migrat­ory hurdles is by all means welcome.

To play devil’s advoc­ate, how­ever, I’d like to point out a defi­ciency of such migra­tion tools. To take an estab­lished example, wit­ness Moz­illa Fire­fox on Win­dows. When you first start it, you are greeted with a friendly wiz­ard to port set­tings and book­marks from Inter­net Explorer. If, like most people, you allow it to pro­ceed, it will replace the carefully-​​selected default Fire­fox book­marks (not to men­tion the awe­some BBC Head­lines live book­mark) with those from IE. The res­ult can be a cluttered, advertising-​​laden (Win­dows Mar­ket­place, any­one?) mon­stro­city that has lost the sim­pli­city and ori­ginal intent of the product being loaded.

The Ubuntu Migra­tion Assist­ant poten­tially raises this application-​​level mis­de­mean­our to an OS-​​level atro­city. As this review of the util­ity demon­strates, even the Tele­tu­b­bies wall­pa­per of Win­dows XP can be migrated with ease, not to men­tion the afore­men­tioned book­marks. This can ruin the inten­ded look and feel of the OS, thus pre­vent­ing the user from exper­i­en­cing the OS in a clean, ‘pristine’ state.

Is this a good or a bad thing? I’m not sure, but what I do know is that the design­ers of this tool should be care­ful to select default set­tings which do not unne­ces­sar­ily alter the user exper­i­ence. Tread care­fully.
 

LotD: Linux Genu­ine Advant­age

Mar 14 2007

When I was little boy In Gram­mar school
Always went by the very best rule
But Ever­time the bell would ring
You’d catch me play­ing with my ding-​​a-​​ling

Thus goes Chuck Berry’s clas­sic, ‘My Ding-​​a-​​Ling’.

At the ripe old age of twenty-​​five, I have been the lucky recip­i­ent of an inguinal her­nia. As men­tioned earlier, I car­ried it through linux​.conf​.au (whilst exer­cising a degree of dili­gence). My oper­a­tion was one week later, con­veni­ently sched­uled for Janu­ary 25. That left me mostly immob­ile for Aus­tralia Day. I passed the time with my laptop whilst the Fox Clas­sics chan­nel broad­cas­ted a mara­thon of Kings­wood Coun­try. I have har­boured fond memor­ies of this clas­sic piece of Aus­trali­ana since my child­hood, and I was glad to be able to see it again. Pre­sum­ably, modern-​​day polit­ical cor­rect­ness keeps it off the air for most of the time, which is a grand shame con­sid­er­ing that the un-​​PC ele­ments were inten­ded as humor­ous plot devices and were not meant to be offens­ive to viewers.

Two days later, against my bet­ter judge­ment, I was walk­ing around and play­ing Wii ten­nis. I had never played a Wii before and it looked like so much fun that I just had to do it! Apart from some dress­ings which lost adhe­sion (due to the abdom­inal twist­ing asso­ci­ated with ten­nis), I was no worse for wear. Now, nearly two months later, I feel com­pletely fine. It sure feels good to have the pro­ced­ure over and done with. Now I can resume my iron­man training…