#!/bin/csh -f
#
# pexall - extract from all files a particular parameter
#
# usage
#  pexall col name dir...
# where col is the parameter number to extract, name is the name of the
# parameter (eg, limit), and dir... is a list of directories 
# to do it in. It extracts non-prefetched files separately from
# prefetched files.
#

if ($#argv < 3) then
	   echo usage: pexall col name dir...
	   exit
endif

set col=$1
set name=$2
shift;shift

foreach dir ($*)
	   (cd $dir; \
	   pextract $col n*.data-a > $name.n ; \
	   pextract $col y*.data-a > $name.y ; \
	   )
end
