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?
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
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.
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)