1752589 Members
4230 Online
108788 Solutions
New Discussion юеВ

Re: LP command options

 
Jeffrey Peters
Occasional Advisor

LP command options

Hello-
Please forgive me, I'm a SAP Basis Admin, not a PCL driver wizard.. :)

All of our print jobs from SAP show up at the printer as "Remote User"; we would like to pass the username through to the printer. I've been researching the -o LP command- but I'm unable to get anything to pass the user name from unix to the printer via the PCL driver. I've tried stuff similar to below:

us3f is the printer name, jdpeters is my ID.

/usr/bin/lp -c -dus3f -n1 -onb -or -oUSERNAME=JDPETERS /tmp/jeff.2

/usr/bin/lp -c -dus3f -n1 -onb -or -oUSERNAME='JDPETERS' /tmp/jeff.2

/usr/bin/lp -c -dus3f -n1 -onb -or -o&USERNAME='JDPETERS' /tmp/jeff.2

/usr/bin/lp -c -dus3f -n1 -onb -or -oUSERNAME /tmp/jeff.2

/usr/bin/lp -c -dus3f -n1 -onb -or -oUNAME /tmp/jeff.1

/usr/bin/lp -c -dus3f -n1 -onb -or -oUNAME='JDPETERS' /tmp/jeff.1

/usr/bin/lp -c -dus3f -n1 -onb -or -oID='JDPETERS' /tmp/jeff.1

We are using HP-UX 11.31 and the HPJL PCL5 driver...

any suggestions would be much appreciated.

10 REPLIES 10
Dennis Handly
Acclaimed Contributor

Re: LP command options

How are you attached to your printer? Local, remote or network?

Have you tried the title: -t'JDPETERS'
Jeffrey Peters
Occasional Advisor

Re: LP command options

I've tried the -t'JDPETERS' item in the print command, it still comes out as "Remote User". All of our printers are network printers. We basically have about 30k users and need to figure out a way to have their userid sent along with their print jobs so we can have the printer hold all prints until they enter their code. We are doing this to cut down on on printing costs, as quite a few users are not picking up their prints.

Rita C Workman
Honored Contributor

Re: LP command options

This forces the print of a banner page, that has under Title the username:

lp -o yb -t $(whoami) -d some.file

Rita
Jeffrey Peters
Occasional Advisor

Re: LP command options

The job still shows up at the pritner as "Remote User"

Tried the following variations:

/usr/bin/lp -o -yb -t$(JDPETERS) -dus3f /tmp/jeff.1
Variable syntax.

/usr/bin/lp -o -yb -t$JDPETERS -dus3f /tmp/jeff.1
JDPETERS: Undefined variable.

/usr/bin/lp -o -yb -tJDPETERS -dus3f /tmp/jeff.1
request id is us3f-259 (1 file) (this one printed, still without coversheet and the job in the printer records was owned by "Remote User" see attached screenshot.
Rita C Workman
Honored Contributor

Re: LP command options

Try letting HPUX use the 'whoami' command to populate the username. Which would change for whoever is printing...

lp -o yb -t $(whoami) -d some.file

/rcw
Jeffrey Peters
Occasional Advisor

Re: LP command options

I've tried that as well..

/usr/bin/lp -o yb -t$whoami -dus3f /tmp/jeff.2
whoami: Undefined variable.

/usr/bin/lp -o yb -t$(whoami) -dus3f /tmp/jeff.2
Variable syntax.

/usr/bin/lp -o -yb -t$whoami -dus3f /tmp/jeff.2
whoami: Undefined variable.


Unfortunately, we would not be able to use the whoami command from unix- since the end users will not have unix accounts, but we are able to directly send the username from SAP to unix by inserting the &0 variable in the profile parameter. So the username will be inserted directly into the print command.

This is starting to drive me crazy.. LOL

Any other suggestions?

Thanks,
Dennis Handly
Acclaimed Contributor

Re: LP command options

>not a PCL driver wizard.. :)

(There are no PCL drivers on HP-UX.)

>I've tried the -t'JDPETERS' item in the print command, it still comes out as "Remote User".

Naturally. The -t option was just a workaround to change the title, if we can't figure out how to change the user.

>so we can have the printer hold all prints until they enter their code.

Then I guess you need the user ID accurate. But how does the printer know which code goes with which users?

>but we are able to directly send the username from SAP to unix by inserting the &0 variable in the profile parameter. So the username will be inserted directly into the print command.

The lp(1) command knows nothing about how SAP prints things nor "inserted directly into the print command".

How did you install us3f?
What does this have:
/var/spool/lp/interface/us3f
Dennis Handly
Acclaimed Contributor

Re: LP command options

You could also look at all of the model scripts to see which control the user ID:
/var/spool/lp/model/*
Jeffrey Peters
Occasional Advisor

Re: LP command options

Thanks, I've looked through the model scripts for the option that controls the user id.. nothing could be found. Since these are just generic PCL and HP drivers, I've downloaded the package for the xerox colorqube for HP-UX. I've forwarded it to our OS team to have it implemented (since they don't give us root.. or any admin rights). Hopefully, I'll be able to find the right option once the correct script is in place. Thanks for everyones help!