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

后端 未结 8 1879
感情败类
感情败类 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:41

    To quote the man:

    The -e option is used to edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables

    Most often if you run crontab -e from X, you have VISUAL set; that's what is used. Try this:

    VISUAL=vi crontab -e

    It just worked for me :)

提交回复
热议问题