Hi list,
When I run 'crontab -e' the screen shows some errors like,
$ crontab -e
Error detected while processing /usr/share/vim/vim82/filetype.vim:
line 10:
E319: Sorry, the command is not available in this version: let did_load_filetypes = 1
When I run 'crontab -e' the screen shows some errors like,
$ crontab -e
Error detected while processing /usr/share/vim/vim82/filetype.vim:
how to fix up it?
either $EDITOR or $VISUAL in my system is empty.
And /usr/bin/editor points to nano.
Andy Smith :
As to why whatever it is set as right now is doing that, first work
out where it is getting the setting from, so echo $EDITOR and echo
$VISUAL. If neither of those are set then ls -la /usr/bin/editor.
Thanks Andy.
either $EDITOR or $VISUAL in my system is empty.
And /usr/bin/editor points to nano.
Then I run this command,
$ sudo update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).
Selection Path Priority Status ------------------------------------------------------------
* 0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/vim.basic 30 manual mode
4 /usr/bin/vim.tiny 15 manual mode
Press <enter> to keep the current choice[*], or type selection number: 3 update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in manual mode
to choose vim.basic as default editor.
In my system both vim.basic and vim are the same stuff,
$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 27 2024 05:34:22)
Included patches: 1-16, 647, 17-579, 1969, 580-647, 678, 648-1848, 4975, 5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859, 1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108, 2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213, 1840, 1846-1847, 2110-2112, 2121
...
$ vim.basic --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 27 2024 05:34:22)
Included patches: 1-16, 647, 17-579, 1969, 580-647, 678, 648-1848, 4975, 5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859, 1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108, 2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213, 1840, 1846-1847, 2110-2112, 2121
...
Then I logged out and re-login the system, run 'crontab -e', the error still shows. Maybe I got bad luck today. :(
Regards.
As to why whatever it is set as right now is doing that, first work
out where it is getting the setting from, so echo $EDITOR and echo
$VISUAL. If neither of those are set then ls -la /usr/bin/editor.
You are getting Vim error messages from a version of Vim that does
not support scripting (probably vim.tiny). That version is probably installed on your system ALONG WITH a version that does support
scripting, but cron does not have the scripting version of Vim on PATH. (Typically, your $HOME & root PATHs are more elaborate than the one to
which cron defaults.) The solution is to set PATH in your crontab.
* Marcus Park <[email protected]> [24-09/14=Sat 06:12 +0800]:
Andy Smith :
As to why whatever it is set as right now is doing that, first work
out where it is getting the setting from, so echo $EDITOR and echo
$VISUAL. If neither of those are set then ls -la /usr/bin/editor.
Thanks Andy.
either $EDITOR or $VISUAL in my system is empty.
And /usr/bin/editor points to nano.
Then I run this command,
$ sudo update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).
Selection Path Priority Status ------------------------------------------------------------
* 0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/vim.basic 30 manual mode
4 /usr/bin/vim.tiny 15 manual mode
Press <enter> to keep the current choice[*], or type selection number: 3 update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in manual mode
to choose vim.basic as default editor.
In my system both vim.basic and vim are the same stuff,
$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 27 2024 05:34:22)
Included patches: 1-16, 647, 17-579, 1969, 580-647, 678, 648-1848, 4975, 5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859, 1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108, 2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213, 1840, 1846-1847, 2110-2112, 2121
...
$ vim.basic --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 27 2024 05:34:22)
Included patches: 1-16, 647, 17-579, 1969, 580-647, 678, 648-1848, 4975, 5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859, 1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108, 2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213, 1840, 1846-1847, 2110-2112, 2121
...
Then I logged out and re-login the system, run 'crontab -e', the error still
shows. Maybe I got bad luck today. :(
Regards.
I just ran crontab -e as a fresh user and it actually invoked /usr/bin/sensible-editor and asked me which editor I wanted to use
(now and in future). So perhaps the man page for crontab is out of
date.
For the record, Debian 12 has vim 9.0.x and a /usr/share/vim/vim90/ directory. According to <https://packages.debian.org/vim>... oh,
that web page is not responding for me. Sorry, I can't check what
version(s) of Debian might have had vim 8.2.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 146:11:36 |
| Calls: | 12,089 |
| Calls today: | 2 |
| Files: | 15,000 |
| Messages: | 6,517,501 |