#!/bin/sh
#
# simple analyze script for svgafft configuration files
#
#   Copyright (C) 1995 Andrew Veliath
#
# To use, set the environment variable DSPCONFIGS
# to the directory containing configs with a /
# appended to it (if this variable is not specified,
# the current directoy will be used).
#
#	$Id: analyze,v 0.6 1995/05/01 22:04:52 drewvel Exp $
#

GLOBALCONFIG=/usr/local/dspconfigs/

if test "$#" -ge "2"; then
	if test "$#" -ge "3"; then
		rest=`echo $* | cut -d ' ' -f 3- `
	fi
	
	config=$2	

	if [ ! -f "$config" ]; then
	  if [ "x${DSPCONFIGS}" != "x" ]; then	
		config=${DSPCONFIGS}$2
	  else
		config=${GLOBALCONFIG}$2
 	  fi 
	fi
	
	echo config \<- $config	

	if [ -f "$config" ]; then
		svgafft `cat $config` $rest -device $1
	else
		echo error: configuration file $2 not found!
	fi
else
	echo "Usage:  analyze <device> <configuration file> [options]"
fi
