|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T m
Length: 1674 (0x68a) Types: TextFile Names: »mkscript«
└─⟦db229ac7e⟧ Bits:30007240 EUUGD20: SSBA 1.2 / AFW Benchmarks └─⟦this⟧ »EUUGD20/AFUU-ssba1.21/ssba1.21E/musbus/mkscript« └─⟦this⟧ »EUUGD20/AFUU-ssba1.21/ssba1.21F/musbus/mkscript«
#! /bin/sh # $Header: mkscript,v 5.2 87/12/09 15:21:41 kenj Exp $ # create script files by permuting the job steps .. # output files labelled script.n, n=1,2,... # **assumption** run from a Workload directory -- so ../mkperm is sensible! if test $# -ne 2 then echo "Usage: mkscript n master-script" exit 1 fi tmp=/tmp/$$ n=$1 shift if test ! -f $1 then echo "mkscript: cannot open \"$1\"" exit 1 fi ns=`grep '^%%' $1 | wc -l` ns=`expr $ns - 1` k=1 while test $k -le $n do awk ' BEGIN { '"`../mkperm -s $k $ns | sed 's/[0-9][0-9]*/perm[i++] = &;/g`"' nj=0 } NR==1 { next } /^%%/ { nj++; next } /^%/ { next } { if (job[nj] == "") job[nj] = $0 else job[nj] = job[nj] "\n" $0 } END { if (job[0] != "") print job[0] for (i=0; i<'$ns'; i++) print job[perm[i]] if (job[nj] != "") print job[nj] print "End-of-Script" }' $1 \ | awk ' { print } /^\.\/keyb / { print "%include",$2 } /^keyb / { print "%include",$2 }' >${tmp}a echo "BEGIN {" >${tmp}b grep '%include' ${tmp}a \ | sed 's/%include //' \ | while read file do echo " fill[\"$file\"]=`cat $file | wc -c`" >>${tmp}b done cat >>${tmp}b <<'End-of-File' } /^%include/ { nch=fill[$2] need=1 next } need==1 && fg==1{ f=0 while (f+70 <= nch) { printf ": +%05d+ FILLER Mary had a little lamb, its fleece was white as snow\n",f f += 70 } printf ": +%05d+ ",nch f += 11 while (f++ < nch) printf "x" print "" need=0 } /^End-of-Script$/ { exit } { fg=1 } /&$/ { fg=0 } { print } End-of-File rm -f script.$k awk -f ${tmp}b ${tmp}a > script.$k k=`expr $k + 1` done rm -f ${tmp}* exit 0