05/04/02 11:46:08
Printer Control 
Support@crinc.com
Back To Support Page
If you used a dumb interface when your printer was added see changes below, click here for the
crnlmap.
vi lpt1
        Start the editor with the printer name
: 
# @(#) dumb 23.3 91/10/16 
# 
# Copyright (C) 1988-1991 The Santa Cruz Operation, Inc. 
# All Rights Reserved. 
# The information in this file is provided for the exclusive use of 
# the licensees of The Santa Cruz Operation, Inc. Such users have the 
# right to use, modify, and incorporate this code into other products 
# for purposes authorized by the license agreement provided they include 
# this notice and the associated copyright notice with any such product. 
# The information in this file is provided "AS IS" without warranty. 
# 
#ident "@(#)lp:model/dumb 1.3.1.2" 
# lp interface for dumb line printer 
#  Below are the common setting for RS232 printer for flow
control {CTSflow Xon/Xoff}You will #have to check you printer
manual to see what your printer is setup for.
/usr/bin/ditty ixon /dev/ttyxxx
        For printers using Xon/Xoff
/usr/bin/ditty ctsflow /dev/ttyxxx  For printers using
CTSflow or ssd-
x="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" 
#Set up some global variables. 
: ${SPOOLDIR:=/usr/spool/lp} 
: ${LOCALPATH:=${SPOOLDIR}/bin} 
#Set up the default filter. 
if [ -x "${LOCALPATH}/lp.cat" ] 
then 
LPCAT="${LOCALPATH}/lp.cat 0" 
else 
LPCAT="cat" 
fi 
#If we are not using a filter, use the default one. 
if [ -z "${FILTER}" ] 
then 
FILTER="${LPCAT}" 
fi 
if [ -x "${LOCALPATH}/drain.output" ] 
then 
DRAIN="${LOCALPATH}/drain.output 1" 
else 
DRAIN= 
fi 
nobanner="no"
           Change
"no" to "yes" for banners to stop printing
for i in $5 
do 
case "${i}" in 
nobanner ) 
nobanner="yes" 
;; 
esac 
done 
if [ "no" = "${nobanner}" ] 
then 
#echo "\014\c"
            Insert
a # sign to stop the first form feed
echo "$x\n$x\n$x\n$x\n" 
banner "$2" 
echo "\n" 
user=`grep "^$2:" /etc/passwd | line | cut -d: -f5` 
if [ -n "$user" ] 
then 
echo "User: $user\n" 
else 
echo "\n" 
fi 
echo "Request id: $1 Printer: `basename $0`\n" 
date 
echo "\n" 
if [ -n "$3" ] 
then 
banner $3 
fi 
fi 
copies=$4 
#echo "\014\c"
           To stop
the second form feed
shift; shift; shift; shift; shift 
files="$*" 
i=1 
while [ $i -le $copies ] 
do 
for file in $files 
do 
0<${file} eval ${FILTER} 2>&1 
#echo "\014\c"
                       
To stop the last form feed
done 
i=`expr $i + 1` 
done 
if [ "no" = "${nobanner}" ] 
then 
echo "$x\n$x\n$x\n$x\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n\n" 
echo "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n$x\n$x\n
$x\n$x" 
echo "$x\n$x\n$x\n$x\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n" 
echo "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" 
echo "$x\n$x\n$x\n$x\n$x\n$x\n$x\n$x\n" 
fi 
#Draining characters might be necessary. 
${DRAIN} 
Back to Hardware
Support
Support@crinc.com
If you selected crnlmap use below as a
example.
: 
# @(#) crnlmap 23.2 91/08/29 
# 
# Copyright (C) 1985-1991 The Santa Cruz Operation, Inc. 
# All Rights Reserved. 
# The information in this file is provided for the exclusive use of 
# the licensees of The Santa Cruz Operation, Inc. Such users have the 
# right to use, modify, and incorporate this code into other products 
# for purposes authorized by the license agreement provided they include 
# this notice and the associated copyright notice with any such product. 
# The information in this file is provided "AS IS" without warranty. 
# 
#! Serial or parallel printer requiring <nl> mapped to <cr><lf> 
# 
printer=`basename $0` 
request=$1 
name=$2 
title=$3 
copies=$4 
options=$5 
shift; shift; shift; shift; shift 
# If it is necessary to change the baud rate or other stty settings for 
#  Below are the common setting for RS232 printer for flow
control {CTSflow Xon/Xoff}You will #have to check you printer
manual to see what your printer is setup for.
/usr/bin/ditty ixon /dev/ttyxxx
        For printers using xon/Xoff
/usr/bin/ditty ctsflow /dev/ttyxxx  For printers using
CTSflow or ssd-
# border around the banner 
x="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" 
#Set up some global variables. 
: ${SPOOLDIR:=/usr/spool/lp} 
: ${LOCALPATH:=${SPOOLDIR}/bin} 
#Set up the default filter. 
if [ -x "${LOCALPATH}/lp.cat" ] 
then 
LPCAT="${LOCALPATH}/lp.cat 0" 
else 
LPCAT="cat" 
fi 
#If we are not using a filter, use the default one. 
if [ -z "${FILTER}" ] 
then 
FILTER="${LPCAT}" 
fi 
if [ -x "${LOCALPATH}/drain.output" ] 
then 
DRAIN="${LOCALPATH}/drain.output 1" 
else 
DRAIN= 
fi 
# the fifth field of the /etc/passwd file is assigned to the variable user 
user=`sed -n "s/^$name:.*:.*:.*:\(.*\):.*:.*$/\1/p" /etc/passwd` 
# nhead gets the value of BANNERS or 1 by default 
nhead=`sed -n 's/^BANNERS=//p' /etc/default/lpd` 
[ "$nhead" -ge 0 -a "$nhead" -le 5 ] ||
nhead=1        Changing 1 to a 0
to stop printing banners
# print the banner $nhead times 
{ 
while [ "$nhead" -gt 0 ] 
do 
echo "$x\n" 
banner "$name" 
echo "$x\n" 
[ "$user" ] && echo "User: $user\n" 
echo "Request id: $request\n" 
echo "Printer: $printer\n" 
date 
echo 
[ "$title" ] && banner $title 
#echo "\f\c"
                                 
Stop form feeds
nhead=`expr $nhead - 1` 
done 
# send the file(s) to the standard out $copies times 
while [ "$copies" -gt 0 ] 
do 
for file 
do 
0<${file} eval ${FILTER} 2>&1 
#echo "\f\c"
                                        
Stop form feeds
done 
copies=`expr $copies - 1` 
done 
} 
#Draining characters might be necessary 
${DRAIN} 
exit 0 
Support@crinc.com
Back To Support Page