Printing filters in Solaris 2.5.1

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
aikencAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jlmsCommented:
Declare your printer as the default printer, your can use the Admintool or the lpadmin (see man page) command.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
aikencAuthor Commented:
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
braveheartCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.