#! /bin/csh -f

if ($#argv < 3) then
        echo "Usage: $0 program disklimit inputfile"
        echo "$0 $*"
        set STATUS = 500
        goto exit_label
endif

set PROGRAM = $1
set DISK_LIMIT = $2
set INPUT = $3
shift
shift
shift

#echo $PROGRAM $DISK_LIMIT $INPUT

limit filesize $DISK_LIMIT

exec $PROGRAM $argv < $INPUT

exit_label:
exit ($STATUS)  # returns the shell status variable

