0

I want to add a crontab entry.
When I run the command

crontab -e

I just get a number as output! How to fix this issue?

https://i.stack.imgur.com/v1RId.jpg

abu_bua
  • 10,783
  • Hello and welcome to Ask Ubuntu! Can you edit your question and post the output of crontab -l? – Daniele Santi Sep 25 '18 at 12:18
  • HI, crontab -l lists the contents of crontab correctly. only the crontab -e command was not working.. i followed the steps outlined by Rovo and selected the editor.. Now its working fine.. – Ravi Kumar CH Sep 26 '18 at 09:12

1 Answers1

2

crontab gets opened with the default editor, which is saved in the EDITOR environment variable.

for me, this is vim:

$ echo $EDITOR
vim

You can run crontab overriding the default editor like this:

EDITOR=editor-of-your-choice crontab -e

to permanently select a default editor, you can simply run this and choose the right number:

select-editor

then, crontab -e should now open with your editor of choice.

See this related question: Changing default crontab editor

pLumo
  • 26,947