Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing from Solaris 9 1

Status
Not open for further replies.

TexO

MIS
Aug 2, 2006
4
US
I'm trying to print from Solaris 9 to a network printer. The printer is defined and pingable. When I sent an ascii file to print it trys to print but prints with no carriage returns. I know this is a simple fix but I can't seem to find it. lpsched is running.

The printers.conf file looks like this:
ap34:\
:bsdaddr=ap34,ap34,Solaris:

The print command looks like this:
lp -d ap34 /etc/hosts

Thanks in advance for any help.
 
Try changing your entry to read:

ap34:\
:bsdaddr=ap34,Solaris:

It is using the printer as the print server and you don't need it to.
 
I also use the mp command when I print out stuff to make it look a lot better.

cat /etc/hosts | mp -s "/etc/hosts file" | lp -d ap34
 
Coffeysm, I tried that and it didn't work. It still prints but has the same formating problem. I stopped and started print services just to make sure.
 
I tried the mp command and that formated very nicely. Now how do I plug that into my printers.conf so that all unix print goes through that utility?
 
I do not think you can plug that into your printers.conf file. You can setup an alias or a wrapper script though to call it automatically.
 
You probably want something like this:
I have not tested it since I am doing it off the top of my head. I always get my script and languages mixed up though so try it out first, LOL.

Code:
#!/bin/sh
PATH=/usr/bin:/usr/sbin
FILE=$1
#
if [ "$1" == "" ] -o [ "$2" == "" ]
 then
    echo "usage: $0 file_name printer_name"
else
    cat $1 | mp -s "$FILE" | lp -d $2
fi
 
I guess great minds think alike. <BG> I wrote a very similar script Friday afternoon. I called it zlp and just use it to print. Thanks for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top