#!/bin/sh case "$1" in *.jpg|*.jpeg|*.png|*.gif) gimp "$1" ;; *) "$EDITOR" "$1" ;; esac