#!/bin/sh testfile="$1" shift if [ ! -f "$testfile" ] then echo "Syntax: $0 " exit 1 fi shebang=$(head -n1 $testfile) cmd=${shebang:2} cmd=${cmd/\/usr\/bin\/runhugs/runhugs} exec $cmd "$@" $testfile