#!/bin/csh
#
# script to cat together (overlay) two or more dstool postscript files
#
# This script comments out each "showpage" command and then 
# appends a single "showpage" at the end of the document.
# The output is sent to stdout and should be redirected or piped
# through lpr
# Ex: If the files p1.ps, p2.ps, and p3.ps are to be overlayed, use
#     		pscat f1.ps f2.ps f3.ps | lpr
# 	OR  	pscat f?.ps > newfile
# 	OR  	pscat f*    > newfile
#     OR even 	pscat f[123].ps | lpr
#
if($#argv < 2) then
	echo "Usage: pscat file1 file2 ..."
	exit 1
endif

cat $argv[1-$#argv] | sed s/showpage/%showpage/
echo "showpage"
exit 0
