How to set default crontab editor ?

The default crontab editor is nano on some systems. This is a pain. You can change this by setting the EDITOR environment variable. In BASH:

srv-4 / # set | grep EDITOR
EDITOR=/bin/nano
srv-4 / # which vi
/usr/bin/vi
srv-4 / # export EDITOR=/usr/bin/vi
srv-4 / # set | grep EDITOR
EDITOR=/usr/bin/vi
_=EDITOR
srv-4 / #

To make the change stick, you can add it to the profile script appropriate for your shell. We put it in /etc/profile.

Any suggestions or questions are welcome.

    0 comments: