Configuring a Toshiba-p351 printer under ISC-386/ix?

David Kozinn david at monymsys.uucp
Wed Nov 22 03:48:44 AEST 1989


I'm running Microport System V/386 here, but I think that the following should
work on an ISC system as well. I took one of the more basic interfaces and
modified it very slightly to support my p351. This does a couple of "tricks" -
The first is that it always resets the printer to use the Qume control codes,
and the second is that it implements the -olq (letter quality mode) and
-odraft (draft mode) commands.

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	p351
# This archive created: Tue Nov 21 11:44:36 1989
export PATH; PATH=/bin:/usr/bin:$PATH
if test -f 'p351'
then
	echo shar: "will not over-write existing file 'p351'"
else
cat << \SHAR_EOF > 'p351'
#ident "@(#)lp:Toshiba P351 Parallel"
# lp interface for printer with	parallel interface
#
#	Modified  for direct support of the Toshiba P351 printer by DBK
#
#	All characters are passed through to printer unmodified.
#	No banners are printed.
#
# Replace the line below to send an initialization sequence to the printer,
# such as the sequence that resets to power-up configuration.  Use
# a command like (hypothetically)
#	echo "\033z\c"
# to send the sequence "ESC z" to the printer WITHOUT a carriage return
# or linefeed (this is what the \c means) if "ESC z" is a command that
# means something to your printer.  The existing command simply advances
# one page (sends ^L).
#
# DBK - The following sequence resets the printer and puts it in Qume 
# emulation mode (in case the default was IBM mode)
echo "\033\015P\033_0"
#
id=$1
name=$2
title=$3
copies=$4

# Parse any options specified by the -o command
# Currently available are:
#	 -draft  Use draft quality output (default)
#   -lq     Use letter quality output

QUALITY=draft

for i in $5
do
	case "$i" in

		-draft | draft | -d | d)
			QUALITY=draft
				;;
		-lq | lq | -LQ | -lq)
			QUALITY=lq
				;;
		esac
done

case "$QUALITY" in
	draft)
		echo "\033*0\c"
		;;
	lq)
		echo "\033*2\c"
		;;
esac

shift; shift; shift; shift; shift
files="$*"
i=1
while [	$i -le $copies ]
do
	for file in $files
	do
		cat "$file" 2>&1
		echo "\014\c"
	done
	i=`expr	$i + 1`
done
if [ $? != 0 ]
then
	disable -r"write error" `basename $0`
	exit 1
fi

exit 0

SHAR_EOF
chmod +x 'p351'
fi
exit 0
#	End of shell archive
-- 
David Kozinn            | UUCP:      {rutgers | uunet}!cbmvax!cgh!monymys!david
MONY Financial Services	| UUCP:      ...!rutgers!princeton!mccc!monymsys!david
Glenpointe Center West  | Internet:  cgh!monymsys!david at manta.pha.pa.us
Mail Drop 75-14         | GEnie:     D.KOZINN
Teaneck, NJ 07666-6888  | Telephone: +1-201-907-6990



More information about the Comp.unix.i386 mailing list