Problem with update-menus command

D. Michael McIntyre michael.mcintyre at rosegardenmusic.com
Thu Oct 25 23:20:55 UTC 2007


On Thursday 25 October 2007, Earl Violet wrote:

> I'm using Ubuntu 7.04.  When I run:
>
> sudo update-menus
>
> I get several screens of:
>
> sh: Illegal option -r
>
> Does anyone have any idea what this means?

I sure don't, but I have a guess.  We ran into a problem like this at 
Rosegarden recently.  Lots of our scripts were set up to assume that /bin/sh 
would be bash when it is in fact dash on a stock Ubuntu system, and bash 
commands were choking dash.

I don't have an "update-menus" on this system, and don't really want to go see 
about installing one.  I had a look at some other update-* scripts, and one 
of them started with:

#/bin/sh -e

So I'm betting your update-menus script starts with:

#/bin/sh -r

That would work on a Debian system, I think, but not on Ubuntu.

$ sh -r
sh: Illegal option -r
$ ls -l /bin/sh
lrwxrwxrwx    1 root     root            4 May 26 19:51 /bin/sh -> dash*

So my guess is very plausible.  This is probably a case of something Ubuntu 
lifted from Debian but did not adapt to the change in which shell was going 
to do the job of /bin/sh.

You can probably fix it by hacking the script to change /bin/sh to /bin/bash, 
or by hacking the system level symlink so that /bin/sh points to /bin/bash 
instead of /bin/dash.  Either way, a more permanent solution would have to 
take place at the package maintainer patch level.
-- 
D. Michael McIntyre 




More information about the kubuntu-users mailing list