Set up a default editor...

The following example shows how to determine if an editor has been defined, and how to set up "vi" as the default.

$ echo $EDITOR
$ 
$ EDITOR=vi
$ export EDITOR
Comment