#------------------------------------------------------------------------------ # run -- commands text to run on ACU Delta Date: 15/12/89 cbg # ------------------------------------------------------------------------------ program="UT/UT00" runcbl="$bin/runcbl" if [ "$1" = "." ] then data=`pwd` export data shift fi pwd=$data;export pwd tput clear config=cblconfig #. setenv if [ "$1" = "-d" ] then debug=$1 shift fi # process arguments while true do case $1 in -b) shift background="y" infile=$1 shift;; -d) debug=$1 shift;; -h) echo "usage: run [-b batchfile] [-d] [-e cpu] [-f dir] [program]" echo echo " -b batchfile ... batch input file" echo " -d ............. debug flag" echo echo "Defaults to current directory and program UT00" exit;; -*) echo "usage: run [-b batchfile] [-d] [-e cpu] [-f dir] [program]" exit;; ?*) program=$1 shift break;; *) break;; esac done echo echo "--------------------------------------------------------------" echo "NOTE: 1) Error File - \$bin/err.$LOGNAME " echo " 2) Configuration File - \$bin/$config" echo " 3) Data Directory - $pwd" echo "--------------------------------------------------------------" echo sleep 2 config=$bin/$config # set up data directory if [ "$FILE_PREFIX" = "" ] then FILE_PREFIX=$pwd/ if [ "$FILE_PREFIX" = "/" ] # indicates $pwd empty then FILE_PREFIX=`pwd`/ fi fi FILE_PREFIX="$FILE_PREFIX ." export FILE_PREFIX echo $FILE_PREFIX $FIL_PREFIX # echo $progs1 cd $progs # must change to progs for prog sub directories to work CODE_PREFIX="$progs $progs/UT " CODE_PREFIX="$CODE_PREFIX UT XR IV AR JC SP PO AP GL RW CW SU AB WP MP SA BM FA IS CU DU CV " export CODE_PREFIX if [ "$TERM" = "vt100" ] then trap "stty kill '^_' intr 'þ' erase '^H' brkint 2>/dev/null" 0 1 2 3 else trap "stty kill '^_' intr '^?' erase '^H' brkint 2>/dev/null" 0 1 2 3 fi stty kill '' intr '^_' erase '^U' -brkint 2>/dev/null A_TERMCAP=$bin/a_termcap export TERM A_TERMCAP # loop until a valid value for "TERM" is found... while true do case $TERM in wy50*) TERM=wy50 stty erase '^H' 2>/dev/null # cat $bin/set.wy50 switches="-1 -3 -8" break ;; wy30*) TERM=wy50 cat $bin/set.wy30 switches="-1 -3 -8" break ;; wy350*) TERM=wy350 cat $bin/set.wy350 switches="-1 -3 -8" break ;; hp700*) TERM=hp700 cat $bin/set.wy50 switches="-1 -3 -8" break ;; wy75*) TERM=wy75 switches="-1 -3 -7" break ;; vt100*) TERM=vt100 switches="-1 -3 -7 -8" break ;; dec-vt100*) TERM=dec-vt100 # harold 21/09/93 switches="-1 -3 -7 -8" break ;; td220*) TERM=vt100 $bin/set.td220 switches="-1 -3 -7 -8" break ;; ansi*) TERM=ansi #$bin/set.ansi switches="-1368" break ;; vwpt*) TERM=vwpt switches="-1 -3 -6 -7" break ;; tvi910*) TERM=tvi910 switches="-1 -3 -6 -7 -8" break ;; fr01*) TERM=fr01 stty erase '^H' 2>/dev/null set.fr01 switches="-1 -3 -5" break ;; ibm3161*) TERM=ibm3161 switches="-1 -3 -5 -8" break ;; wy60* ) TERM=wy60 stty erase '^H' 2>/dev/null cat $bin/set.wy60 switches="-1 -3 -5 -7" break ;; vt52*) TERM=vt52 switches="-1 -3 -5 -7 -8" break ;; icl6402*) TERM=icl6402 switches="-1 -3 -5 -6" break ;; 97801*) TERM=97801 switches="-1 -3 -5 -6 -8" break ;; link125*) TERM=link125 switches="-1 -3 -5 -6 -7" break ;; ti940*) TERM=ti940 cat $bin/set.ti940 switches="-1 -3 -5 -6 -7 -8" break ;; esp925*) TERM=esp925 switches="-1 -3 -4" break ;; hp0*) TERM=hp0 switches="-1 -3 -4 -8" break ;; dg461*) TERM=dg461 switches="-1 -3 -4 -7 -8" break ;; ncr7901*) TERM=ncr7901 stty erase '^B' 2>/dev/null #switches="-1 -3 -4 -7" switches="-1 -3 -6 -8" break ;; sun*) TERM=sun switches="-1 -3 -4 -6" break ;; *) echo -n " Unknown Terminal Type: \"$TERM\" -- Known Terminal Types Are: 1 wyse 50 2 wyse 350 3 wyse 75 4 vt100 5 ansi 6 viewpoint 7 teli video 910 8 freedom one 9 ibm 3161 10 wyse 60 11 vt52 12 icl 6402 13 siemens 97801 14 link 125 15 texas instruments 940 16 esprit 925 17 hewlett-packard 2392A 18 data general D461 19 ncr 4920 in 7901+ mode 20 sun 3 workstation Enter Terminal Type (q = quit): " read TERMINAL case $TERMINAL in 1 ) TERM=wy50;; 2 ) TERM=wy350;; 3 ) TERM=wy75;; 4 ) TERM=vt100;; 5 ) TERM=ansi;; 6 ) TERM=vwpt;; 7 ) TERM=tvi910;; 8 ) TERM=fr01;; 9 ) TERM=ibm3161;; 10 ) TERM=wy60;; 11 ) TERM=vt52;; 12 ) TERM=icl6402;; 13 ) TERM=rm97801 ;; 14 ) TERM=link125;; 15 ) TERM=ti940;; 16 ) TERM=esp925;; 17 ) TERM=hp0 ;; 18 ) TERM=dg461 ;; 19 ) TERM=ncr7901;; 20 ) TERM=sun;; q ) exit 1 ;; esac ;; esac done export TERM if [ "$background" = "y" ] then $runcbl $debug $switches -w -c $config $program $$ <$infile else $runcbl -vv $runcbl $debug $switches -l -e $bin/err.$LOGNAME -x -w -c $config $program $$ fi if [ "$TERM" = "wy60" ] then cat $bin/reset.wy60 fi #if [ "$TERM" = "ansi" ] #then #$bin/reset.ansi #fi if [ "$TERM" = "vt100" ] then stty kill '^_' intr 'þ' erase '^H' brkint 2>/dev/null else stty kill '^_' intr '^?' erase '^H' brkint 2>/dev/null fi exit 0