How to specify a editor to open crontab file? “export EDITOR=vi” does not work

后端 未结 8 1942
感情败类
感情败类 2021-01-30 02:56

I\'m using Red Hat Enterprise Linux 5, and I want to set the vim editor to edit the crontab file.

If I run echo $EDITOR, I get vim. But when I run c

8条回答
  •  情深已故
    2021-01-30 03:38

    If the above methods don't work (as they didn't work on my Ubuntu 13.04 installation) try:

    There are a number of alternative ways:

    1) Run select-editor

    select-editor
    

    2) Manually edit the file: ~/.selected_editor specifying your preferred editor. With this option you can specify editor parameters.

    # Generated by /usr/bin/select-editor
    SELECTED_EDITOR="/usr/bin/emacs -nw"
    

    3) You can specify on the fly on the commandline with:

    env VISUAL="emacs -nw" crontab -e
    

提交回复
热议问题