#!/bin/ksh # File: errcmp.sh # Purpose: This script will look for *src/*.err files and add them # to the Lawson compiler queue. USAGE="\nUsage: $0 [-U] [-l] \n -U Optional - Compile Programs with User Exits\n -l Optional - Compile Locally, Avoiding Queues\n" if [[ $# -eq 0 ]]; then print $USAGE exit fi PGM=qcompile if [[ $# -eq 1 ]]; then PL=$1 UX= fi if [[ $# -eq 2 ]]; then PL=$2 PARM1=$1 case $PARM1 in -U) UX=-U;; -l) PGM=lawcmp;; esac fi if [[ $# -eq 3 ]]; then PL=$3 PARM1=$1 case $PARM1 in -U) UX=-U;; -l) PGM=lawcmp;; *) echo "Invalid Parameter..\n$USAGE"; exit 1;; esac PARM2=$2 case $PARM2 in -U) UX=-U;; -l) PGM=lawcmp;; *) echo "Invalid Parameter..\n$USAGE"; exit 1;; esac fi #set -x cd $LAWDIR/$PL echo "Finding errors..." for ProgCode in `find . -type f -name "*.err"` do Program=`basename "$ProgCode" | cut -f 1 -d '.'` SysCode=`dirname $ProgCode | cut -c3-4` echo "Compiling $Program" $PGM $UX $PL $SysCode $Program done