* Monique Y. Herman (spam@bounceswoosh.org) [031009 15:32]: > On Thu, 09 Oct 2003 at 20:30 GMT, David Z Maze penned: > > "Monique Y. Herman" <spam@bounceswoosh.org> writes: > > > >> I'd never heard of update-alternatives or /etc/alternatives until a > >> few days ago on this list, and to be honest I'm still a little (a > >> lot) foggy on what exactly it's used for. For instance, I have > >> /etc/alternatives/vi and /etc/alternatives/editor ... what > >> applications will use these values? > > > > nvi, vim, and elvis (all vi clones) will register alternatives for vi; > > these, plus emacs, xemacs, nano, etc. will be alternatives for editor. > > > > Yes, I understand that. What I don't understand is, what uses these > registries? Does the system set $EDITOR to /etc/alternatives/editor > under the cover? Will typing "kedit" suddenly get me vim? What apps > respect alternatives instead of, say, $EDITOR or $PAGER, and how do I > find this out? Or is this just a convenience that I can choose to use > when setting up my own users? No, I think you're imagining it to be far more complicated than it is. wingnut:~$ type vi vi is /usr/bin/vi wingnut:~$ \ls -o /usr/bin/vi lrwxrwxrwx 1 root 20 2003-04-23 09:25 /usr/bin/vi -> /etc/alternatives/vi wingnut:~$ \ls -o /etc/alternatives/vi lrwxrwxrwx 1 root 12 2003-05-28 15:42 /etc/alternatives/vi -> /usr/bin/vim wingnut:~$ \ls -o /usr/bin/vim -rwxr-xr-x 1 root 1151736 2003-02-08 12:53 /usr/bin/vim So when I type 'vi', I get vim, via some symlinks. That's all. Any program that tries to invoke /usr/bin/editor will get vim: wingnut:~$ \ls -o /usr/bin/editor lrwxrwxrwx 1 root 24 2003-04-23 09:25 /usr/bin/editor -> /etc/alternatives/editor wingnut:~$ \ls -o /etc/alternatives/editor lrwxrwxrwx 1 root 12 2003-09-21 01:43 /etc/alternatives/editor -> /usr/bin/vim wingnut:~$ \ls -o /usr/bin/vim -rwxr-xr-x 1 root 1151736 2003-02-08 12:53 /usr/bin/vim I don't know if kedit does some funky stuff (I've never used it), but I imagine it is an editor in its own right, and that there are no alternatives for kedit (/usr/bin/kedit is not a symlink to something in /etc/alternatives; it is a binary -- unless my assumptions are wrong, since I've never used kedit). > (Also seems weird to me that a bunch of pointers to executables would be > stored in /etc, but maybe that's just me.) They are part of the configuration of the system. My having an /etc/alternatives/editor that points at vim is a representation of a preference for vim. It's just one step lighter than having /usr/bin/editor be a wrapper script that executes vim. So /etc is a good place for it, since it is configuration. good times, Vineet -- http://www.doorstop.net/ -- http://www.anti-dmca.org/
Attachment:
signature.asc
Description: Digital signature