Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
cancel
Showing results for 
Search instead for 
Did you mean: 

ksh shell print command

SOLVED
Go to solution
Joseph Hoh
Frequent Advisor

ksh shell print command

I have installed a xerox printing software that insatlled a command called "print". It is set in my PATH. The command is found when I do a "which print". But when I try to execute it the shell command "print" takes precedence over the installed xerox "print" command. Is there away around this?
5 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: ksh shell print command

Hi Jeff:

I'd define an alias for the "print" in you profile that points to the full path executable:

# alias printx=/

...JRF...
Vincenzo Restuccia
Honored Contributor

Re: ksh shell print command

For printing use lp.
Tracey
Trusted Contributor

Re: ksh shell print command

Would it work if you tried executing the print command using the full pathname?

Re: ksh shell print command

Since print is a special command ( built in command ) for the shell , the shell will try and execute the special command ( in the current shell process ) before searching the PATH variable. The "which" command output has verified that you have set up your PATH correctly to use the Xerox executable. After this, the following should work .

# ksh print
or
# sh print

This will force the search through your PATH Variable.
Tim Malnati
Honored Contributor
Solution

Re: ksh shell print command

The easiest way around this is to invoke the command with the full path (same as the which command output). I know its extra typing but this method takes things like PATH variables and shell internal mechanisms out of the picture.