#!/bin/csh -f
#
# expand-suite
#
# expand a suite file from a one-trial file into a multi-trial file
#
#
# Part of
#              The STARFISH Parallel file-system simulator
#        (Simulation Tool for Advanced Research in File Systems)
# 
#                               David Kotz
#                           Dartmouth College
#                              Version 3.0
#                              January 1996
#                          dfk@cs.dartmouth.edu


if ($#argv != 2) then
  echo usage: expand-suite suite-filename  num-trials
  exit 1
endif

gawk < $1   -v ntrials=$2  '\
$NF == 1 {\
    for (t = 1; t <= ntrials; t++) { \
        for (i = 1; i < NF; i++) \
	    printf "%s ", $i;  \
        print t;  \
    } \
    next;\
} \
{ print }'
