#! /bin/sh cd "$(dirname "$1")" case "$1" in */Makefile) exec xtopen -K make ;; *) exec xtopen vi "$1" ;; esac