#!/bin/bash
# CVS: $Id: runplot_all,v 1.9 2006/01/03 18:11:25 rijsman Exp $
# Tag: $name$
# Info: $CVSROOT/IDEA-DEV/COPYRIGHT

if [ $# -le 1 ]; then
	echo 'Usage: ./runplot_all <search_directory/log_name(s)> <output_dir>'
	echo "Note: It is the user's responsibility to provide the correct"
	echo "directorys and regular expressions.  Quotations must be used"
	echo "when specifying a regular expression."
	echo ""
	echo 'Example:'
	echo './runplot_all "real/*" PlotLogs2'
	echo './runplot_all "Logs/*/*out.log" PlotLogs2'
	echo './runplot_all "real/*/*e.log*[0-9][0-9]" PlotLogs2'
	echo ''
	exit
fi

logname=$3
searchdir=$1

count=1
fileCount=`ls -1 $searchdir | wc -l`

for myloop in $searchdir
do
 	cmd=${0%/*}"/plot_all "$myloop" "$2
 	echo "["$count" of "$fileCount"] Creating plots for "$myloop" in "$2"."
	let count=$count+1
	$cmd
done
