Formfeed after each file


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Formfeed after each file
# 1  
Old 10-31-2003
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
# 2  
Old 10-31-2003
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.
# 3  
Old 10-31-2003
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.
# 4  
Old 10-31-2003
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.
# 5  
Old 11-03-2003
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?
# 6  
Old 11-03-2003
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
# 7  
Old 11-03-2003
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies

2. Shell Programming and Scripting

sed or awk: delete n lines following a formfeed

Hi Members, This is my first post in this forum. I want to do is match form feed lines one by one in a file and delete the next n lines (ex-3 lines) with the form feed character Eg - Files looks like Data 1 Data 2 Data 3 FF Hdr1 Hdr2 Hdr3 Data4 Data5 FF Hdr1 Hdr2 Hdr3 (9 Replies)
Discussion started by: yohan
9 Replies

3. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies

4. Shell Programming and Scripting

Match list of strings in File A and compare with File B, C and write to a output file in CSV format

Hi Friends, I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving... File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies

5. Solaris

formfeed problem

i am running an .sql script in sqlplus which is spooling in a file. but when i am opening the file using vi editor it is showing ^L in front of 1st,2nd and last line. when i am opening the file with cat this problem is not there. how to solve this problem? this above mentioned file is the input... (1 Reply)
Discussion started by: imppayel
1 Replies

6. UNIX for Advanced & Expert Users

lp FormFeed Escape characters

I'm trying to modify the /usr/lib/lp/model/netstandard file to generate a header for all the print jobs that are sent, but there is no formfeed defined so the the job prints right after the header with no page break. What is the sequence I need in order to generate a formfeed? Or, do you have... (4 Replies)
Discussion started by: jgordon
4 Replies

7. UNIX for Dummies Questions & Answers

FormFeed BEFORE printing a job

I have a problem where my printer formfeeds a blank page prior to printing a job. Anyone know where I can turn this off? AIX O/S - RS-6000 (2 Replies)
Discussion started by: Docboyeee
2 Replies
Login or Register to Ask a Question

Featured Tech Videos