1825793 Members
2264 Online
109687 Solutions
New Discussion

Alias and LP string

 
SOLVED
Go to solution
rmueller58
Valued Contributor

Alias and LP string

All,

another "issue" that I am getting from the users is they don't want to "pick" a printer from a pick list, they want to have a default defined.. Not a problem LPDEST does the job to define the que, But they have an issue..

MOST thankfully are running HP.

I need to define "lp" to
alias "lp -oc -ovsi7.27"

Can someone give me a short and skinny way of defining an alias in the user's profile so we can user proof the printing?

I've tried launching a shell script by doing a
. shellscriptname

the shell script looks like this:

alias lp='lp -oc -ovsi7.27'

I've tried putting this line in the user/.profile and it doesn't work..

Any insight appreciated.

Rex Mueller -- ESU3
9 REPLIES 9
Victor BERRIDGE
Honored Contributor
Solution

Re: Alias and LP string

Greetings,

But hvae you tried:
. shellscriptname
in the .profile?


All the best
Victor
Victor BERRIDGE
Honored Contributor

Re: Alias and LP string

Othewise put the aliases and custom env in .kshrc
and add in .profile

export ENV=$HOME/.kshrc



All the best
Victor
OldSchool
Honored Contributor

Re: Alias and LP string

another (less elegant approach) would be to move /usr/bin/lp to /usr/bin/real_lp and replace it w/ a script. something like:

#!/bin/sh

/usr/bin/real_lp -oc -ovsi7.27 $@

rmueller58
Valued Contributor

Re: Alias and LP string

Victor,

I've tried both, the alias is retained if I su - to the user in question and execute command line printing, however when the user goes into the "accounting" app, apparently there is a subshell that executes and that particular alias is not available to the user.

If I didn't have 500 user accounts on the system that use lp defaults, I'd opt for testing the real_lp method but I'd be hanging from the nearest pole if I tried that as we sit.

I need to do some digging. Perhaps one of the subshells that launch the app is revoking all the aliases that are predefined.
Bill Hassell
Honored Contributor

Re: Alias and LP string

The question is a lot more complicated because of the special application. The environment (including aliases) must be defined for the user and it looks like the application is quite non-standard. su - appuser is somewhat non-standard (a direct login is assumed for all the preceding recommendations) and su appuser is very non-standard since nothing in the appuser's profile will be run. Perhaps the application is performing a (dumb) su and this is causing the problem.


Bill Hassell, sysadmin
Victor BERRIDGE
Honored Contributor

Re: Alias and LP string

I agree with Bill and Oldschool...
and believe your only option is if your users accept to type an extra char would be the script you call lp2 that you put in /usr/bin:

#!/usr/bin/sh
/usr/bin/lp -oc -ovsi7.27 $@
#

an like you dont touch at lp...


All the best
Victor
Victor BERRIDGE
Honored Contributor

Re: Alias and LP string

oops typo...
You should read:
and like that,you dont touch at lp...

sorry
rmueller58
Valued Contributor

Re: Alias and LP string

The software vendor uses an Informix variable "DBPRINT" to handle default printing, I am trying that as I believe their "variable" in their system defaulted exports was overriding kshrc and the .profile.

Thanks all for the info..
rmueller58
Valued Contributor

Re: Alias and LP string

Thanks All