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 crontab -e
, I get different editor.
To use Cron, you must establish an SSH connection to your project. Then, enter the crontab -e command to open the crontab file. Note: The crontab file is located in the /var/spool/cron directory. The vi editor will open by default when calling crontab -e.
The very first time you issue the crontab command with the -e (edit) option in a Bash terminal, you're asked to pick the editor you'd like to use. Type crontab , a space, -e and press Enter. The editor you select is then used to open your cron table.
Very probable that your VISUAL
environment variable is set to something else. Try:
export VISUAL=vi
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 :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With