#!/bin/sh
#
#	Author:		Andrew Guthrie
#	SCCS id:	@(#)PS	1.2 8/1/95
#
#	Copyright Insignia Solutions Inc
#
#	Purpose and use:
# Shell script to strip out the leading CTL-D chars from Postscript
# output from Windows 3.X which stops printing from working. To use
# it set the LPTn port to be a pipe with $SWIN2HOME/bin/PS as the destination.
# This then pipes to lp with the args provided.
#

ARGS=$*

if test -x $SWIN2HOME/bin/PSfilter
then
	:
else
	echo "PS:  $SWIN2HOME/bin/PSfilter: does not exist or not executable"
	exit 1
fi

if test -x /usr/bin/lp
then
	:
else
	echo "PS:  /usr/bin/lp: does not exist or not executable"
	exit 1
fi

# Can't check the existence of the printers with lpstat because it doesn't
# return an error code when the destination doesn't exist.

#
# Invoke the filter to strip out the CTL-Ds which cause the problem
$SWIN2HOME/bin/PSfilter | /usr/bin/lp $ARGS
