edit crontab with emacs
You can edit your crontab file with “
crontab -e“. It worked fine as long as I used vim. However, when I switched to emacs and set the
EDITOR environment variable to point to emacs, I couldn’t edit my crontab file normally. Emacs is started in the background and somehow it caused problems.
I made a script for editing my crontab file. This script sets
EDITOR back to vim, thus “
crontab -e” opens vim. Here is the script:
#!/usr/bin/env bash # crontab_e EDITOR=/usr/bin/vim crontab -e
I call this script “crontab_e”, so it’s easy to remember its name.