#!/bin/sh
cmd=dgs;
while [ 0 ]; do
clear
echo 0. Set output command. Is $cmd
echo a. Ghostscript examples 
echo b. Postscript files in /Library/ps 
echo x. Exit
read x
if   [ "$x" = "0" ]; then
	echo Input cmd
	read cmd
elif [ "$x" = "a" ]; then
	for file in /usr/lib/ghostscript/examples/*.ps 
	do
	clear
	echo Enter y to process $file
	read x
	if [ "$x" = "y" ]; then
 		$cmd $file
	fi
	done 
elif [ "$x" = "b" ]; then
	for file in /Library/ps/*.ps 
	do
	clear
	echo Enter y to process $file
	read x
	if [ "$x" = "y" ]; then
 		$cmd $file
	fi
	done 
elif [ "$x" = "x" ]; then
	clear
	exit
fi
done
