| On 6/6/05, Jari Aalto <[EMAIL PROTECTED]> wrote: | > | Um, what did get invoked? joe, jmacs, or something else? | > | | > | Your alternatives are set for jmacs to start, and that's what should | > | have happened, unless you've futzed with sensible-editor or something. | > | > It selected "joe". I would have expected to see "jmacs". No, | > I havent touched shell script sensible-editor which would | > have chosen nano for me, since EDITOR/VISUAL are not set. | > | > Would this have somethign to do with symlinks? | > | > lrwxrwxrwx 1 root root 3 Jun 2 20:42 /usr/bin/jmacs -> joe | > | > If symlinks are resolved, what is left is "joe", but that is | > a wrong command. "joe" is binary who detects its mode according | > to first argv parameter it was invoked | | It could very well have something to do with the use of symlinks. | What happens if you call /usr/bin/editor directly from the command | line? I suspect you would get the same result, since argv[0] would be | "editor" - not "jmacs".
You're correct. Running "editor" gives plain "joe". The editor should be handled specially from the other alternatives links, so that script could resolve the first link and call exec. Like this: $ cd /etc/alternatives $ mv /etc/editor editor.link $ cat editor #!/bin/sh # Read the binary pointed by link for item in $(ls -l /etc/alternatives/editor.link) do path=$item done exec $path "$@" # End of file Would you redirect this bug to right address (dpkg?) Thanks, Jari -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]