#! /bin/sh set -e editor=${MDW_EDITOR-ed} case "$EDITOR,$VISUAL,$TERM" in mdw-editor,mdw-editor,dumb) editor=gnuclient;; mdw-editor,mdw-editor,*);; *,mdw-editor,*) editor=$EDITOR;; mdw-editor,*,*) editor=$VISUAL;; esac exec $editor "$@"