Solved

Printing filters in Solaris 2.5.1

Posted on 1997-06-30
3
264 Views
Last Modified: 2013-12-27
How do I setup a magic printing filter that is used by lpr so that whatever type of file I'm printing I just type lpr filename, and it prints it out to the default printer?  Can anybody point me to any web pages which deal with this, or can you tell me how you did it?  Thanks
0
Comment
Question by:aikenc
3 Comments
 
LVL 4

Accepted Solution

by:
jlms earned 100 total points
ID: 2006465
Declare your printer as the default printer, your can use the Admintool or the lpadmin (see man page) command.
0
 

Author Comment

by:aikenc
ID: 2006466
I know how to make the printer the default printer.  I was more interested in setting up the magic filter so that I can print just about any type of file by just typing lpr filename.
0
 
LVL 3

Expert Comment

by:braveheart
ID: 2006467
There are so many different types of file that leaving it to the
operating system to decide is probably expecting too much. Only
you know how you want each different type of file formatted.
Also, there are many files which you will not want to print at
all, such as executable files. If you have compressed files you
will want to uncompress them first, before you decide how to
print them.

What I would suggest is writing a script which uses "file" and
looks at the file extension to decide what sort of file you are
trying to print and sets the printing options appropriately.

The script might even look at the contents of some files to
further refine its printing options. For example, you might want
plain text files to be printed in one way if every line in the
file is less than 80 characters long but use a different setup
if some lines are more than 80 but less than 132 chars.

The script could be called "lpr" and be placed in the PATH or
could be aliased.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now