head	1.1;
access;
symbols;
locks
	dfk:1.1; strict;
comment	@# @;


1.1
date	96.07.04.02.59.41;	author dfk;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@#!/bin/csh -f
#
# qex - quickly extract a parameter from a set of sim files
#
set usage='usage: qex parameter-name foo.sim[.gz]...'
#
# Part of
#              The STARFISH Parallel file-system simulator
#        (Simulation Tool for Advanced Research in File Systems)
# 
#                               David Kotz
#                           Dartmouth College
#                              Version 2.0
#                              January 1995
#                          dfk@@cs.dartmouth.edu

if ($#argv < 2) then
	echo "$usage"
	exit 1
endif

set tmp=/tmp/qex$$
onintr cleanup

set stat=$1
foreach file ($argv[2-])
    (statgraph -s -m -f $file \
     | grep "\[$stat\]" \
     | awk '{print $NF}' > $tmp \
     ) >& /dev/null

    set val=`cat $tmp`
    echo $val $file
end

cleanup:
rm -f $tmp
@
