Hi!
I'm trying to use create a simple print filter with bash on Red Hat Linux. The filter is to work with CUPS, using "System V type script" interface. The printer is emulating an Epson FX 1050. The original problem was when using CUPS PPD, the printer is too slow. I also can't use "raw" que because I need to do a form feed and end of job. So I'm trying to use a simple script as a filter. I'm trying to use the following script:
#! /bin/bash
#set debug
set -x
#set input
[ -n "$6" ] && exec <"$6"
#initialize printer
echo -en "\030\100"
#process input
while read line; do
# replace tabs with spaces
sed -u 's/ / /g' $line
echo $line
done
# form feed after printing
echo -en "\f"
The problem is that on a 3 page report, the first page is compressed to left margin (not doing horizontal spacing properly - tabs or spaces) and part of the first page is placed at end of report! Pages 2 and 3 are okay. Without the sed line, all pages are compressed to left and I get some weird error at the end of the report. There is probably something wrong with the script but I just don't see it. Any ideas?
Thanks!!
I'm trying to use create a simple print filter with bash on Red Hat Linux. The filter is to work with CUPS, using "System V type script" interface. The printer is emulating an Epson FX 1050. The original problem was when using CUPS PPD, the printer is too slow. I also can't use "raw" que because I need to do a form feed and end of job. So I'm trying to use a simple script as a filter. I'm trying to use the following script:
#! /bin/bash
#set debug
set -x
#set input
[ -n "$6" ] && exec <"$6"
#initialize printer
echo -en "\030\100"
#process input
while read line; do
# replace tabs with spaces
sed -u 's/ / /g' $line
echo $line
done
# form feed after printing
echo -en "\f"
The problem is that on a 3 page report, the first page is compressed to left margin (not doing horizontal spacing properly - tabs or spaces) and part of the first page is placed at end of report! Pages 2 and 3 are okay. Without the sed line, all pages are compressed to left and I get some weird error at the end of the report. There is probably something wrong with the script but I just don't see it. Any ideas?
Thanks!!