#!/bin/sh
#
# Copyright:
#	Copyright (C) 1994 by T. Weidenfeller. All rights reserved
#	
#	You are free to copy, modify and distribute this software as you
#	see fit, and to use it for any purpose, provided this copyright
#	notice and the warranty disclaimer are included without any
#	modification in all copies and modifications. You have to mark all
#	modifications clearly and you are also commited to give propper
#	acknowledgment of the original source if you include this software
#	or parts of it in another software.
#	
# Warranty:
#	The BiTronics device driver and the accompaning material is a free
#	sample of no commercial value. It comes without any warranty:
#	
#	THERE IS NO WARRANTY OF ANY KIND WITH REGARDS TO THIS MATERIAL,
#	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#	MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The author
#	shall not be liable for errors contained in the material or for
#	incidental or consequental damage in connection with the
#	furnishing, performance, or use of this material.
#	

DEV=${1:-/dev/bt1}
echo Using device $DEV
echo Sending command...

cat > $DEV << EOT
%-12345X@PJL COMMENT
@PJL ECHO === Request # $$ starts ===
@PJL INFO VARIABLES
@PJL ECHO === Request # $$ ends ===
EOT
echo done.

sleep 1	# printer is slooooow

echo Reading result...
cat $DEV | gawk '{ gsub("\014", "<Form feed replaced>\n"); print }' | more
echo done.
