Operating System - HP-UX
1835975 Members
1951 Online
110088 Solutions
New Discussion

Problem putting Titles on printouts

 
George Doller
Frequent Advisor

Problem putting Titles on printouts

I am running the following, and when I run it with just a profile for example, I get the banner page telling me the file name. When I run it with a report that was generated I don't get a banner page. Any ideas on getting a banner on the front of my reports to distinguish between them.

for FILE in `ls /etc/profile`
do
if [ -f "$FILE" ]
then
lp -dxop3 -t "$FILE" "$FILE"
fi
done

When I substitute /etc/profile for a directory with reports I don't get a banner page.
Thanks
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: Problem putting Titles on printouts

Hi George:

You can put the title of each file along with page numbers with 'pr':

# pr -F | lp

You could also establish an offset and a number of lines per page specification, like this:

# pr -F -o16 -l66 | lp -d

...JRF...
Rita C Workman
Honored Contributor

Re: Problem putting Titles on printouts

I just made one simple change to your script...tested it and I got banner pages (for each file under a directory) that noted the full path name of the file as the title...

for FILE in /home/rworkman/myfiles/*
do
if [ -f "$FILE" ]
then
lp -dxop3 -t "$FILE" "$FILE"
fi
done

Regards,
/rcw
George Doller
Frequent Advisor

Re: Problem putting Titles on printouts

When I used the pr -F it moved all the fields around. I guess I would need to figure out the offsets. I was kinda looking for an easy way out.
Thanks
George Doller
Frequent Advisor

Re: Problem putting Titles on printouts

I guess I should have mentioned, it works with HP printers, but it doesn't work with Xerox Docuprint printers.