Using mpage -h


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Using mpage -h
# 1  
Old 10-24-2011
Using mpage -h

I am using mpage and want to assign the title myself using -h. However I still want to have the date and Page numbers when using -H.
In summary I want to have the same output as using -H (last file modification, filename and page number), however I want a way to change the filename using -h, for example -hfname, where fname is the file name without the path.
Is there a way to do this?
# 2  
Old 10-26-2011
Hi.

You probably noticed that mpage routes text through utility pr. The pr utility is very basic. You have a few possibilities for a solution. One, you could find a better utility than pr ( I use an old code from a statistics package for such work ) -- you need to be able to specify a kind of format that includes symbols for placing interesting data in the header, like date and file. Two, you could find a replacement for mpage, such as enscript, which allows flexibility like:
Code:
       -b header, --header=header
               Use the text header as a page header.  The default page header
               is constructed from the name of the file and from its last
               modification time.

               The header string header can contain the same formatting
               escapes which can be specified for the %Format directives in
               the user defined fancy headers.  For example, the following
               option prints the file name, current date and page numbers:

               enscript --header='$n %W Page $% of $=' *.c

excerpt from man enscript

So, there is no really easy answer that I know of.

Best wishes ... cheers, drl
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using mpage

I am trying to use mpage. I want to print 4 pages on one page, with a specified margin. I have tried /usr/bin/mpage -m40 -lW160 -4AHPRanD_BW_1 jcdint.rc Everything is ok. However it is printing in landscape rather than portrait. (2 Replies)
Discussion started by: kristinu
2 Replies
Login or Register to Ask a Question