Crontab -e not saving when EDITOR set to vim

Please consider this session:

EDITOR=vim
crontab -e
# add ### test
crontab -l

Result: nothing was saved into crontab. Now you do the same but instead of vim you’ll use vi (EDITOR=vi). It will work. Any idea why?

Works here the same as using default vi editor.

No need to set EDITOR and just use vi and problem is solved. You don’t do much with crontab anyway :slight_smile:

Thank you. I put EDITOR=vim into .profile not because I can use it to edit crontab, but because I generally prefer vim over vi. It’s also funny that the editing works fine on my home Linux PC no matter whether vi or vim is set.

As I wrote above it works for me with vim too.

But because you didn’t wrote which image you were using I tested CE21 nightly.

Also it’s rather interesting that no syntax check is being performed (you may enter a line that cannot be parsed and yet vi/vim won’t complain).

This issue is maybe because busybox cron is used and doesn’t do any syntax checking.

This issue is maybe because busybox cron is used and doesn’t do any syntax checking.

Yeah, that would explain it.

But because you didn’t wrote which image you were using I tested CE21 nightly.

I am on 20.1-Nexus. vim installed from virtual.system-tools. I suppose I’ll just need to wait for next stable release then. Thanks for sharing.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.