I have a problem with a filter.
I have writed a very simple filter:
replace "@PJL SET USERCODE = \"\"" "@PJL SET USERCODE = \"0002\"" "%%BeginFeature: *UserCode None" "%%BeginFeature: *UserCode \"0002\""
saved as /usr/lib/ifhp/mkc
My /etc/printcap is:
It works as shell command, and also as a filter, but the file queued and send to printer is not the output of filter, but the original file without replaced terms. If I make a redirection (e.g. replace "@PJL SET USERCODE = \"\"" "@PJL SET USERCODE = \"0002\"" "%%BeginFeature: *UserCode None" "%%BeginFeature: *UserCode \"0002\"" >/tmp/output ), the output file containts the correct replaced terms.
Please, can anyone help me?
Thank you very much in advance
Rafael Pérez Muñoz
Universidad de Extremadura
Badajoz - Spain
Try looking at lpq -L to see if there are any messages about the filter, perhaps that can give a hint.
What do you mean with "If I make a redirection"? Do you mean changing the script or running the commands you give manually?
If you mean manually, have you checked the script is actually run? (It it is not, add some diagnostics to check that and make sure the paths are correct and the script is actually executeable).
You could also try to make your script something like
cat > /tmp/1.tmp
replace … … < /tmp/1.tmp > /tmp/2.tmp
and take a look at the generated temp files.
Also note that filter scripts are relatively complex. Perhaps using something like magicfilter to call your filter but doing all
the rest (like for example not filtering when it gets -c and so on). Most likely that has nothing to do with your problem but
will otherwise make the whole more smooth (like avoiding your filter being run two times and such things)…
since you have a very simple filter you can use the following the technic:
IMHO this is more easy to debug.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.