All,
Q: how would I add some escape codes to an interface that i have setup t print.?
Goal: to switch from NLQ to Util modes. back and forth.
Scenerio:
SCO OS 5.05
PRINTER: OKI Data 320 or similar. printer is called "test"
What I have done thus far. (just cannot get their)
I can from a #prompt
bash#echo -e "\033\170\061\033\153\0" | lp -d test
(results my printer changes to NLQ mode properly.)
any echoing from this point results in all text being NLQ mode quality...
Alternatively
bash#echo -e "\033\170\00" | lp -d test
(results my printer switches back to UTIL mode)
any echoing from this point results in all test being UTIL MODE quality
I have a pgm that uses a config file for all its output which just doesnt allow for these codes to be inserted.
In case your wondering its a BB3 pgm that uses a config.bbx file.
the current line status is
alias P6 ">lp -dtest -s 2>/dev/null" "AT PO's Fast" CR,SP=1B4D,SPCOLS=80,CP=1B4D,CPCOLS=104,EPON=1B77011B5701,EPOFF=1B77001B5700,EPCOLS=2
,EPLINES=2,WAIT=0
alias P7 ">lp -dtest -s 2>/dev/null" "AT PO's NLQ Pls Set NLQ NOW." PTON=1B77311B6B0,SP=1B77311B6B0,CR,SPCOLS=80,CP=,CPCOLS=104,EPON=,EPO
FF=,EPCOLS=2,EPLINES=2,WAIT=0
In the above I have tried lots of variations to toggle the NLQ/UTIL mode.. all with no luck.
So I was thinking I could modify a printer interface specifically the dumb one and make 2 printer scenerios.
DumbNLQ and DumbUTIL and then just send the desired output to the desired printer interface.
Also, I did try the
lp -o nlq -d test
and
lp -o lq -d test
my particular printer just does not respond to those options (fond in the man lp pages)
I have been trying to insert the octal codes above into a dumb interface script <below) . for my printer all with no luck.
the dumb script is below.
I have commented out some of it for banner page reasons. But where if at all possible would I add the codes to toggle the printer mode.?
*********************************** Begin dumb interface Script ***************************
:
# @(#) dumb 25.2 95/03/27
#
# Copyright (C) 1988-1995 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
#
x="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
#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"
if [ -z "${BANNERS}" ]
then
nhead=1
else
nhead=${BANNERS}
fi
for i in $5
do
case "${i}" in
nobanner )
nobanner="yes"
;;
esac
done
#if [ "no" = "${nobanner}" ] ;This is the stock line.
if [ "yes" = "${nobanner}" ]
then
while [ $nhead -gt 0 ]
do
#echo "\014\c" "remed out by SR to stop extra 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
#nhead=`expr $nhead - 1`
nhead=0
done
fi
copies=$4
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" # "Remed out by SR to stop extra from feed..." "
done
i=`expr $i + 1`
done
#if [ "no" = "${nobanner}" ] ;This is the stock line
if [ "yes" = "${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}
exit 0
********************************** End of Script ***************************************
Thanks in advance for your time!
Sam