Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Printing filters in Solaris 2.5.1

Posted on 1997-06-30
3
Medium Priority
?
292 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
[X]
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
3 Comments
 
LVL 4

Accepted Solution

by:
jlms earned 200 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

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

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

636 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