Details
OS: Solaris 10 , update 11
HW: M5-32 LDOM, V490, IBM x3650, T5240, VMware virtual machine, etc...
EDITOR=vi
term=vt100
tmp directory=/var/tmp
cron shell=/sbin/sh
My shell=/bin/bash
Issue
A very interesting error occurs when attempting to modify the crontab via crontab -e.
If I attempt to search for a non-existent string utilizing crontab -e to verify and check syntax with vi as my editor, and then try and save, it will puke back and tell me an error has occurred even if no changes were made.
Example
admin@server# export EDITOR=vi
admin@server# crontab -e
In command mode, search for a non-existent string like "foobar123". After receiving the "Pattern not found" then attempt to :wq and you'll receive...
The editor indicates that an error occurred while you were
editing the crontab data - usually a minor typing error.
Edit again, to ensure crontab information is intact (y/n)?
('n' will discard edits.)
If you are cheeky and choose to go right back in and attempt to save it will now save sans error. This is repeatable from on all types of Solaris from VMware to M5-32 LDOM, to a V490 physical. Curious as to why cron would interpret a search for a non-existent string as an error, but not say visudo.
A related note is Solaris 11 will not produce this error, which then begs the question if this is some sort of POSIX specification why it would apply to Solaris 10 and not 11?