Home > bash > edit crontab with emacs

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

crontab -e

I call this script “crontab_e”, so it’s easy to remember its name.

Categories: bash Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: