- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Printing headers and footers in UNIX
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-22-2002 07:36 AM
тАО02-22-2002 07:36 AM
Thanks!
Theresa
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-22-2002 07:42 AM
тАО02-22-2002 07:42 AM
Re: Printing headers and footers in UNIX
if I understand your posting the right way, you can use awk:
awk 'BEGIN {print "whatever_you_want"} {print $0} END {print "whatever_you_want"}' /dir/file
> /dir/"changed_file"
This would print "whatever_you_want" before printing the rest of the file, after printing the contents of the file it would print "whatever_you_want". The output would be redirected into the /dir/changed_file.
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-22-2002 07:47 AM
тАО02-22-2002 07:47 AM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-22-2002 08:16 AM
тАО02-22-2002 08:16 AM
Re: Printing headers and footers in UNIX
The "pr" option sounds like the best road to take. To implement that, I would create my own lp script that piped lp to pr?? Would there be a way to have the user put in what they wanted the header/footer to be?? It would have to be configurable because each document will have a different classification. I suppose I could have different printer names depending on the classification needed and just wrap them with the correct headers embedded in my scripts. Okay, now I am rambling...what do you think?
Thanks,
Theres
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-22-2002 08:39 AM
тАО02-22-2002 08:39 AM
Re: Printing headers and footers in UNIX
There is a problem with pr in that you have limited control over the footer. If you output is to HP Laserjet's or compatibles, let me suggest one other alternative. Check out a product called Unform. http://www.unform.com
This will supply you with enough intelligence to handle almost any situtation and can be simply incorporated into each of your interface scripts.
This is not a simple task and if you don't use Unform, some fairly complex Perl or awk is going to be required to preprocess your files before sending them to lp. You will generally have to do things to condense the print so that the normal 66 lines will print and still allow for the header and footer on each page. That is something that a simple BEGIN/END awk block can't do.
If I were doing this, I would look hard at UnForm because it's the one possible solution that would be adaptive enough to handle whatever input stream you send it and also let you 'fit to page'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-22-2002 12:58 PM
тАО02-22-2002 12:58 PM
Re: Printing headers and footers in UNIX
Theresa