#!/bin/ksh ######################################################### # rndcmp.sh - randomly compiles a productline to avoid # contention of int files # Unix version of 'compfirst.bat' by Brent Hawkinson # J. David Schronce ######################################################### if [[ -z $TMPDIR ]]; then TMPDIR=/tmp fi if [[ $# -eq 0 ]]; then echo "$0 productline" exit 2 fi PLINE=$1 cd $LAWDIR/$PLINE # Get list of all pgms by their scr names find . -name *.scr | sed 's/.scr//g' | grep -v backup | sed "s/src//g" > $TMPDIR/tmp1.$$ # Get all the system codes cut -f 2 -d / $TMPDIR/tmp1.$$ > $TMPDIR/tmp2.$$ for i in `cat $TMPDIR/tmp2.$$` do echo $PLINE >> $TMPDIR/pline.$$ done # Get the program names cut -f 3 -d / $TMPDIR/tmp1.$$ > $TMPDIR/tmp4.$$ # Combine files pr -m -t -s" " $TMPDIR/pline.$$ $TMPDIR/tmp2.$$ $TMPDIR/tmp4.$$ > $TMPDIR/tmp5.$$ # Randomize the list while prepending 'qcompile $PLINE' awk '{print int(3000 * rand() + 1),"qcompile",$0}' $TMPDIR/tmp5.$$ > $TMPDIR/qcmp1.$$ cat $TMPDIR/qcmp1.$$ > $TMPDIR/test.$$ sort -n $TMPDIR/qcmp1.$$ > $TMPDIR/qcmp2.$$ cut -d" " -f2-5 $TMPDIR/qcmp2.$$ > $TMPDIR/rndcmp_$PLINE.sh srgen $PLINE chmod 777 $TMPDIR/rndcmp_$PLINE.sh $TMPDIR/rndcmp_$PLINE.sh #Cleanup rm $TMPDIR/tmp1.$$ $TMPDIR/tmp2.$$ $TMPDIR/tmp4.$$ $TMPDIR/tmp5.$$ $TMPDIR/qcmp1.$$ $TMPDIR/qcmp2.$$ $TMPDIR/pline.$$