![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reading a file and writing the file name to a param file. | thebeginer | UNIX for Advanced & Expert Users | 1 | 10-05-2007 05:38 PM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 05:25 AM |
| formfeed problem | imppayel | SUN Solaris | 1 | 02-03-2005 12:38 AM |
| lp FormFeed Escape characters | jgordon | UNIX for Advanced & Expert Users | 4 | 10-15-2003 03:01 PM |
| FormFeed BEFORE printing a job | Docboyeee | UNIX for Dummies Questions & Answers | 2 | 08-23-2002 04:34 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
||||
|
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. |
![]() |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|