On Sun, Feb 5, 2012 at 17:40, Lukas Fleischer <archlinux@cryptocrack.de> wrote:
visudo(8) does more than locking. It performs basic syntax checks after editing and tells you if (and where) any errors were found. It's the right tool for this job, so why bother with workarounds if using another editor is as simple as setting "$VISUAL" or "$EDITOR" (which you should do in your shell rc file anyway if you're not used to using vi(1))?
$EDITOR is already set in my .bashrc. I always tried to run it this way: ~ $ sudo visudo but it never worked. Even putting vars before invoking sudo does not work: ~ $ EDITOR=nano VISUAL=nano sudo visudo I just found out that sudo clears (at least some) environment variables and you have to put this variable after 'sudo'. ~ $ sudo EDITOR=nano visudo I did not use visudo because I never bothered trying to make it work with nano. Thanks to you, I now know how. -- Sébastien Leblanc