Formfeed after each file

Have a line printer that uses the script /etc/lp/interfaces/citoh script when processing print jobs. I've developed the header so that it will print a page break before the start of each page. When you print single files, this works fine. But, if you print multiple files (e.g. lp -d citoh *.fil), the header is not invoked before each file. Thus, the subsequent files start printing right after the previous file even if it's right in the middle of a page.

I would like to generate a page break after the end of each file. Alternatively, I'd like to invoke the header so that each file name is identified for each printed file.

Thanks in advance

Since we don't have a copy of your citoh file, we can't you exactly how to proceed. But what you want is very common and there is probably already a way to do it in the script. Look at the options... do you one called pageskip oo nopageskip or filebreak or nofilebreak or something like that? You shoild probably just be able to toggle the value.

I found the nofilebreak="no" entry, which means that "I do want a file break". I tried toggling the value but the same thing happened as before. Would you like me to send the citoh file to you? I was looking at the "exit_code" section as a place to force a formfeed after it has finished printing a file, but I'm not sure where to put it.

It soungs like you are using a model script similiar to the one on my solaris system.

If so "exit_code=`cat ${EXIT_CODE}`" seems to be where the file gets printed. And down just a little bit is the test to try a page break. Either your $FF or your $nofilebreak is not set the way it should be. Put is a few debug statements and figure out why. For example after the "cat" line above, put in "echo exit_code = $exit_code". This will print on your listing, but it's temporary while you figure it out.

I don't have that specific syntax, but I put the echo command after each time I found something similar. However, it did not print on my printouts. Is there a particular section description that would help narrow down exactly where each file gets printed/processed? What appears to be happening is that the script is only invoked once and treats the wildcard entries as a single input to the script. When the same command is used to send the multiple files to a laser printer through Jet Direct, the EOF marker triggers a formfeed so that the different files are properly separated. Any other suggestions?

First, I would create a datafile with several lines in it and formfeeds between the lines. Try to print that to make sure that the printer responds to formfeeds.

If that works, your goal is to insert a formfeed bewteen each file. If this doesn't work, you will need to find an escape sequence that will formfeed.

As for the echos, switch to
echo something >> /tmp/printdebug

Printer does respond to formfeeds, and it's the same sequence used in the header. I added the code so that there is a formfeed after the header prints.

I created a little script that I may end up using to filter my print requests. Right now it is hardcoded to loop through all the files in a directory and then print them using the lp interface. I then get my header and file breaks.

I just can't seem to get the lp interface to break apart each of the files when you use wildcard characters in the command line. It treats "*.ext" as one entry and thus doesn't invoke the lp interface to process between files.

If you have any other suggestions, people to contact or websites to review, I would appreciate it. I also appreciate your help thus far in helping narrow down my options.

It's supposed to do that. Somewhere in the script is something like

for file in ${files}
do

<stuff goes here>
done

That is where it loops on each file. Somewhere in that loop is the formfeed logic. You can find it by looking for the nofilebreak. Figure out why it's not working by echo stuff to a temp file.

hi

if i have understood your query correctly, then you may try the following;

if u can edit the files then u may insert a ^l (control L) either at the end or at the begining of the file or u can store a ^l in a separate file and you can fire it wherever u want for a form feed.

raguram R