Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Modification of the Banner Page in HP-UX 11.31

Rob Hussey
Advisor

Modification of the Banner Page in HP-UX 11.31

I need to put the filename to be printed out on the banner page of a remote printer. I am looking in /var/spool/lp/interface/model.oprig/$printer, and see the following:

echo "\t\t\t\t\tRequest: $jobid from $syst\n"
if [ "$jrpg" -eq 0 ]
then
echo "\t\t\t\t\tOptions: $files"
fi
if [ -n "$invalidopt" ]
then
echo "\t\t\t\t\tInvalid Options: $invalidopt\n"
else
echo ""
fi
if [ -n "$title" ]


I have been playing with the variable after the Options: to try to put the "/tmp/file" to be printed.

Syntax of the printing is -> lp -d$printer /tmp/file.

Printing is fine, I am just looking at tweaking the banner page.

TIA

- Rob
- Rob Hussey
3 REPLIES
Bill Hassell
Honored Contributor

Re: Modification of the Banner Page in HP-UX 11.31

When a printer script is run by lpsched, the following parameters are provided:

$1 = request ID number
$2 = Login name of the requestor
$3 = Title (may be null)
$4 = Copy count
$5 = -o options
$6 = file(s) to print

You didn't mention which printer script you are using. Many of the scripts have the source filename in the first few lines:

head /var/spool/lp/interface/model.orig/myprinter

Somewhere in the script, the first 5 parameters will be assigned to variables and there will be either shift; shift; shift; shift; shift or shift 5. That makes the filenames(s) to be printed the rest of the command line. Again in a typical script, the rest of the line $* will be printed in a loop, something like this:

files="$*"
...
for file in $files
do
...

So in this example, $file will be the filename as supplied to the lp command. You can insert the current filename "$file" anywhere in the banner page code.


Bill Hassell, sysadmin
Rob Hussey
Advisor

Re: Modification of the Banner Page in HP-UX 11.31

Printer type file being used is /users/hpnp/odyssey/repository/sh/net_lj4x.psh,v 1.2 2002/05/06 21:45:21
- Rob Hussey
Rob Hussey
Advisor

Re: Modification of the Banner Page in HP-UX 11.31

$file is null and $files echo's the actual request file, and not the file to be printed.
- Rob Hussey