I've got a script (I didn't create) that is being used as an Output filter to convert NL to CRNL. It works fine, but I don't understand it enough to fix an issue.
I have another script that will send a single-byte file to a printer just to wake it up. That single byte is a hex "00" (null).
The CRNL filter below eats up the null and creates a completely EMPTY print stream, of which the spooler refuses to act upon.
Here's the filter/script:
When i pipe my nullfile to the script, the output is completely empty (as verified using "hd").
Is there a way I can either allow the null to pass unaffected, or set a conditional so this script is only invoked if the data in the pipe is > 2 bytes long?
"Proof that there is intelligent life in Oregon. Well, Life anyway.
I have another script that will send a single-byte file to a printer just to wake it up. That single byte is a hex "00" (null).
The CRNL filter below eats up the null and creates a completely EMPTY print stream, of which the spooler refuses to act upon.
Here's the filter/script:
Code:
:
# addcr - filters to add CARRIAGE RETURN to LINEFEED in text
#
# addcr adds CR to each LF
#
CR=`echo | tr '\012' '\015'`
sed "s/$/$CR/" $*
When i pipe my nullfile to the script, the output is completely empty (as verified using "hd").
Is there a way I can either allow the null to pass unaffected, or set a conditional so this script is only invoked if the data in the pipe is > 2 bytes long?
"Proof that there is intelligent life in Oregon. Well, Life anyway.