#!/bin/sh
for i in geany leafpad "urxvt -e mcedit" ;do

    i2=`echo $i |sed 's/urxvt -e //'`
    [ -n "`which $i2`" ] && ($i "$@" &) && exit
done
