The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-31-2003
jgordon jgordon is offline
Registered User
  
 

Join Date: Oct 2003
Location: Atlanta
Posts: 21
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 (permalink)  
Old 10-31-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,122
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 (permalink)  
Old 10-31-2003
jgordon jgordon is offline
Registered User
  
 

Join Date: Oct 2003
Location: Atlanta
Posts: 21
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 (permalink)  
Old 10-31-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,122
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 (permalink)  
Old 11-03-2003
jgordon jgordon is offline
Registered User
  
 

Join Date: Oct 2003
Location: Atlanta
Posts: 21
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 (permalink)  
Old 11-03-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,122
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 (permalink)  
Old 11-03-2003
jgordon jgordon is offline
Registered User
  
 

Join Date: Oct 2003
Location: Atlanta
Posts: 21
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.
Closed Thread

Bookmarks

Tags
solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:00 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0