1753777 Members
7590 Online
108799 Solutions
New Discussion юеВ

Re: Printer

 
Sharon Bi_4
Occasional Advisor

Printer

Hi,

I set the default printer using HP JetAdmin on a HP 10.20 as root. And when
run " lp FILENAME " , it works fine.

But when I login as another user's account:

1) if i do a " lpstat -d ", it show the right default printer.

2) if i do a " lp FILENAME", it waits for sometime and then say: " the
destination " " non-existent "

3) if I use the GUI Printer Manager, I can not even see that default printer.

Does anybody know what' need to be setup?

Many thanks in advance!

Sharon
7 REPLIES 7
Fernando Santana
Frequent Advisor

Re: Printer

Hi, try checking the "PRINTER" variable. This
variable takes precedence over the systems default
printer queue. Maybe the user's .profile or the systems /etc/profile has it
wrong.

export PRINTER=DefaultPrinterQueueName
Sharon Bi_4
Occasional Advisor

Re: Printer

I have tried: export PRINTER=DefaultPrintQuequName
and confirmed this by using: echo $PRINTER. The output is right.

But I still get the name thing:

eg: lp FILENAME
lp: destination "" non-existent
Zeng Qing yong
Occasional Contributor

Re: Printer

The printer might not have been installed correctly. Check the connection of
the printer, config it and have a test print.

The environment variable has correct value, and lp was trying to connect to the
printer but failed.
So the possible cause is the connection or the driver of the printer.

Queyon
Sharon Bi_4
Occasional Advisor

Re: Printer

Queyon,

I don't think it's the connetion problem. Because if I login as ROOT, every
thing is find. This problem happens only when I login as a particular user.
Victor Berridge_1
Occasional Advisor

Re: Printer

Hi Sharon,
looks to me more of a perm problem, it your default printer were not defined
you would get a msg like:
no system default destination
is it a network printer with ip in /etc/hosts in such case is /etc/hosts
readable for everyone etc...
Good luck!
Best regards
Victor
Paul Hite_2
Frequent Advisor

Re: Printer

Check the environment variable LPDEST. It may be set and if so, it takes
precedence over PRINTER. Also make sure that you are using the correct lp
command by trying /usr/bin/lp to see if that works better. This user could
have an alias or a private version of lp on his path.
Zeng Queyon
New Member

Re: Printer

Type in the following shell script and save it as 'longlist':

#######################################################
#!/bin/sh

if [ $# -ne 2 ]; then
echo " Usage: `basename $0` [Input_File] [Output_File]"
echo "Example: `basename $0` /tmp/inputfile.txt /tmp/outputfile.txt"
echo ""
exit 0
fi

INPUT_FILE=$1
if [ ! -f ${INPUT_FILE} ]; then
echo "File ${INPUT_FILE} not found."
echo ""
exit 1
fi

OUTPUT_FILE=$2
if [ -f ${OUTPUT_FILE} ]; then
rm ${OUTPUT_FILE}
fi

echo "Getting long list from ${INPUT_FILE}"
echo " into ${OUTPUT_FILE}"

for GET_FILE in `cat ${INPUT_FILE}`; do
ls -l ${GET_FILE} >> ${OUTPUT_FILE}
done

echo "done."
echo ""

exit 0

#######################################################

Change the mode to be executable by running:
$ chmod 755 longlist

And then run it without parameter first:
$ longlist

Enjoy it!

Queyon