#!/bin/bash prog="$1" if [ -z "$prog" ] ; then echo "usage: $0 prog options" echo "example:" echo " $0 sylpheed-claws --select inbox " exit 1 fi firstchar="${prog:0:1}" if [ "$firstchar" != "/" ] ; then prog=`which "$prog"` firstchar="${prog:0:1}" fi if psfindexec "$prog" ; then echo "already running" exit 1 else exec "$@" & exit 0 fi