Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Solaris 2.6 and 7 printcap and printers.conf entry

Posted on 2000-04-13
Medium Priority
Last Modified: 2013-12-21
For both the Spac and Intel version 2.6 and 7, is there an entry that I can put in the printcap or printers.conf file to get rid of the dreaded Staircase effect when printing.  I've written shell scripts to take care of this, but I'm looking for an easier way.  This is a remote printer and I don't have access to the remote system, only the printer.  Also worth noting, the printer does not have a setting to set lf->cr/lf.  I'm looking to do the conversion berfore the job is sent to the remote system.  For HP, I modified the rmodel interface script, but HP's printing system is different from Solaris.  
Question by:hpman
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 3
  • +2

Expert Comment

ID: 2712716
What sort of printer are you using? A typical example for an HP Deskjet would be:

Step #1. Adding "of" line to printcap          

hp|hplj|HP_Deskjet1600c:        :lp=/dev/bpp0:\        
        :of=/usr/lib/deskjet.filter:\   ---->Add this line.
Step #2. Creating the filter.
# vi /usr/lib/deskjet.filter
Add the following info to the file.
Note. Make sure you include the single quotes where applicable and following
instructions below to insert the escape codes correctly or filter will not
The '&k2G' is to correct the staircase effect and 'E' is to eject the page.

#!/bin/csh -f
/usr/bin/echo -n '&k2G'
if      ($status == 0)  then
/usr/bin/echo -n 'E'
                exit 0
        exit 1

How to Insert Escape Code

Note. Select "i" for insert mode under VI.
Inserting <esc>&k2G

Press '
Press "ctrl" and "v" keys together. This will produce a ^
Press "esc" key this will produce [
Enter &k2G
Press '

Use same procedure for <esc>E

To check the escape code was inserted correctly execute;

cat -v /usr/lib/deskjet.filter    ---> Should appear as   '^[&k2G'


chmod 755 /usr/lib/deskjet.filter

Author Comment

ID: 2712832
The printer is an Océ 3165 which has an OS/2 PC as a controller.  This is why I need to do the conversion before it is sent to the remote system.  Currently, I have access to the Intel version of Solaris.  It's printers.conf file looks completely different than what you described.  The entries look like this:  3165:\ (next line down):\bsdaddr=3165,dac,Solaris:  If I put the if/of=/var/lib/3165.filter before the second line, the system tells me the printer is unknown.  If I put it after, I still get the staircase.  I'm working on getting access to a Sparc station to see if your solution works there.
LVL 40

Expert Comment

ID: 2714630
Solaris doesn't use a printcap file, it being a SysV printing system. What printer type are you using on Solaris to print to the device? Does the printer do a Postscript or PCL emulation?
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 2716043
The printer is capable of both.
I copied the /etc/printers.conf file to the tmp directory and used conv_lpd to convert the copy from a printers.conf file to a printcap entry.  I added the of=... line and then used conv_lpd to convert it back and used the /tmp/printers.conf.  It made no difference.  I've also tried editing the /usr/lib/lp/model/standard and forcing the filter to equal the location of my script.  Any help would be greatly appreciated.
LVL 40

Expert Comment

ID: 2718248
You could set the printer type neatly for a network printer with Solstice AdminSuite, but it can also be done via a command line. Since you say it can do both Postscript & PCL, we'll set it up as a Postscript printer as that's more compatible with Solaris. I'm assuming that you can send jobs to the remote printer via BSD LPR/LPD protocol.

The first thing to do is to see if the SysV printer filters have been set up with "lpfilter -l -f all". If there aren't any listed, the easiest way to get the system to set them up is to add (and then remove) a dummy postscript printer with admintool. Just tell it that the printer is local on any port, it doesn't matter which.

Verify that "lpfilter -l -f all" now shows filter types, and then you can set up a network printer. In the example below I've used "prt" for the queue on the node "". You'll need to change the remote queue name and nodename to suit. Create the queue for a remote networked printer with:

root> lpadmin -p prt -T PS -I PS -F continue -o nobanner \
> -h -v /dev/null -m netstandard -o \
> -o protocol=bsd -D "PS Printer"

I normally disable banner page printing by editing the interface file (/etc/lp/interfaces/prt in this example) and change "nobanner=no" to "nobanner=yes".

Then enable printing with:

root> enable prt
root> accept prt

You can look at the man pages for the commands I've used for more info.

Author Comment

ID: 2737996
Adjusted points from 20 to 100

Author Comment

ID: 2737997
I'm thoroughly confused!  Your suggestion did not work.  I've tried just about every option for lpadmin.  The last attempt that has me so confused is what interface script is actually being run?  I used the following commands to create a basic remote printer
lpadmin -p test -s dac ! test -v/dev/null (or use admintool to create a remote printer)
I can print to the printer.  I next create an executable called test which does nothing more than cat "hello" to a tmp file.  I used the -i and -m options for lpadmin to point to this.  Nothing appears in the tmp directory and the job prints.  With HP, rmodel is used for remote printers.  I modified that script for this printer and it works fine.  I've tried modifying both the standard and netstandard files, but from the above test, they don't seem to run for a remote printer.  Any idea's would greatly be apprciated.
LVL 40

Expert Comment

ID: 2738277
It may not have worked when you used my example as the "remote printer" might not implement the BSD LPR/LPD printing service (or perhaps not in an RFC compliant manner). Is it a "raw network" service or is it supposed support the LPR/LPD protocols?

Author Comment

ID: 2738573
It's supposed to support LPR/LPD.  

Expert Comment

ID: 2855596
We have opened up a new Solaris Topic Area.  

To increase the visibility of questions, we moved questions we felt
appropriate to the new Solaris Topic Area where they will be easier for
Solaris experts to find and answer. You may view your question at 

If you have any questions about the new topic area you can contact
Community Support by posting a comment at the following URL or by
emailing us at 

Community Support @ Experts Exchange


Accepted Solution

Geddy earned 400 total points
ID: 2997453
I have 2.6 and 2.7 boxes here where I work. In our printer.conf file,
this is how we have them setup.

#       If you hand edit this file, comments and structure may change.
#       The preferred method of modifying this file is through the use of
#       lpset(1M) or fncreate_printer(1M)

When I added the printer through the admintool, I also was getting the
staircase effect. Once I looked at one of our other boxes here with these settings, and changed them appropriately, that effect went away.

In the example above, "nocprint" is the printername, foulmouth is the hostname to DNS resolves for nocprint's IP.

All I can say is, the above setting worked for me. I think that "text" and "Solaris" were missing from the entry when I tried to add the printer with the admintool.

Expert Comment

ID: 3075812
Whoa, I think I had points taken away from me on this one. Wasn't this answer accepted middle of last week?

Author Comment

ID: 3075990
You should have gotten the points.

Expert Comment

ID: 3076070
Initially, I did, but it looks like they were taken away. I wonder if it had anything to do with Experts Exchange server crashing. Another guy on here I know said that the server crashed. He lost points, and comments. I seem to have lost comments from other questions as well.

Author Comment

ID: 3076230
This was the e-mail that I received this morning.  I don't know who you would contact.

Dear Experts Exchange Members,
As many of you noticed yesterday, our site was having significant technical
problems. Late Friday night, our third-party hosting facility suffered a
severe crash and our site went down as a result.  We've worked non-stop to
recover and rebuild our site and database hosted on their servers. As we
send out this e-mail, the site is back up and we'll be monitoring it around
the clock to ensure its stability.
We sincerely thank all of you for your patience. We're taking steps to make
sure that this will never happen again.
Needless to say, it's an exciting time to be a part of the Experts Exchange
community. We value your contribution to the site, and are planning several
new enhancements in the near future that will make Experts Exchange even
Thank you again for your patience,
The staff at Experts Exchange

Expert Comment

ID: 3110353
Comment accepted as answer

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question