#!/bin/ksh
. ${WFU_PATH}/global.site.ksh
unset noclobber
unalias rm
#-------------------------------------------------
#will launch matlabx
#syntax: launch_script host script rsh_flag 
# $1 = display
# $2 = script
# $3 = outputfile
#-------------------------------------------------
#display=$1
#script=$2
#outputfile=$3
priority=$4
if [[ ${#priority} -eq 0 ]];  then
	priority=19
fi
DISPLAY=${1}:0
export DISPLAY
cmd=$batch_matlab
#touch $3
echo "Running: nice -n $priority $cmd < $2 >> $3"
printenv
nice -n $priority $cmd < $2 >> $3
exit
