Appending CR to syslog output?
Dan Nelson
dnelson at allantgroup.com
Fri Nov 5 07:46:36 PST 2004
In the last episode (Nov 05), Kevin A. Pieckiel said:
> How do I get syslog to append a CR to output when it's being sent to
> a line printer on /dev/lpt0?
Couple of options here:
o Tell your printer that eols are LF instead of CRLF (if it can be
configured to remember this on powerup)
o Log to "|sed -e 's/$/^m' > /dev/lpt0" (where ^m is a raw CR)
o If your printer knows an escape sequence to put it in LF mode, log
to "| echo 'escsequence' ; cat > /dev/lpt0"
o Set up a printcap with an input filter that adds the CR (or sends
the magic escape sequence), and log to "|lp"
o Edit syslogd.c to add the CRLF if the device printed to starts with
"/dev/lpt"
--
Dan Nelson
dnelson at allantgroup.com
More information about the freebsd-questions
mailing list