[luau] screen success

Ray Strode halfline at hawaii.rr.com
Tue May 28 21:00:00 PDT 2002


I've played around with "screen" and it seems to work fine for
printing.  The only thing I can think now is we'll need an lpr-type
program to send the printed output too.  I think we can probably get
away with a shell script.  Maybe something like this (untested):

--lpr.bash-----------------------------------------------------------
#!/bin/bash -

# Create a file to temporarily hold the contents to be outputted
TEMPFILE=$(mktemp /tmp/pos_print.XXXXXX || exit 1)

# Put the contents to be printed in the file
cat > $TEPMFILE

# Send the contents of the file to each file (or device) specified
# as commandline args when running the script
for OUTPUT_DEVICE in $*
do
    cat $TEMPFILE >> $OUTPUT_DEVICE
done

# Delete the temp file
rm -f $TEMPFILE
---------------------------------------------------------------------

Then we should be able to specify in /etc/screenrc on each end system
something like

printcmd 'lpr.bash /dev/lp0 /dev/ttyS0 /var/log/pos/transaction.log'

or something.  For systems where all hardware is connected to the
parrallel port there would be no need for /dev/ttyS0 ofcourse.

--Ray




More information about the LUAU mailing list