Why crontab -e doesn't use the correct editor?

Marius Gedminas marius at pov.lt
Mon Nov 14 14:27:16 UTC 2011


On Fri, Nov 11, 2011 at 10:59:24AM -0600, Peng Yu wrote:
> Hi,
> 
> ~$ echo $EDITOR
> 
> ~$ echo $VISUAL
> 
> ~$ ll /usr/bin/editor
> lrwxrwxrwx 1 root root 24 2010-05-14 17:23 /usr/bin/editor ->
> /etc/alternatives/editor
> pengy at pengy-desktop:~$ readlink -f -e /usr/bin/editor
> /usr/bin/vim.gnome
> 
> I have the above environment. But when I call run "crontab -e". nano
> is invoked. I think that vim.genome should be called. I'm wondering
> why the correct one is not called?

$ strings $(which crontab)|grep editor
/usr/bin/sensible-editor

/usr/bin/sensible-editor is a shell script that tries $VISUAL, EDITOR,
a $SELECTED_EDITOR (which I'd never seen before), and it spawns some
text-mode interactive menu (/usr/bin/select-editor), or looks for a
saved setting in ~/.selected_editor.  It falls back to nano if none of
the other options work.

What's the content of ~/.select_editor, if the file exists?

Crontab's manual page appears to be incorrect where it says crontab will
use /usr/bin/editor.  I'd be inclined to file a bug about that.

Marius Gedminas
-- 
A witty saying proves nothing.
                -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20111114/4b9b9f2e/attachment.sig>


More information about the ubuntu-users mailing list