
The ECN No Name Newsletter is no longer being published. This is an archived issue.
[previous article] [next article]David Curry
The following article is a reprint of a portion of ECN 199-E,
Migrating To Solaris And The Common Unix Environment. To
obtain a copy of the complete document, please contact your
site specialist.
The printing system provided with Solaris represents a
complete change from the one used on SunOS and other ECN UNIX
systems. On SunOS and other ECN UNIX systems, we use the
Berkeley Line Printer system, usually referred to as the LPR
system. This package includes the lpr, lpq, and lprm commands
with which we are all familiar. On Solaris however, we will
be using the System V Line Printer system, commonly referred
to as LP. The commands provided with the LP system are
similar in functionality to those provided by the LPR system,
but they have different names and use different command line
arguments.
-d and -n
options), converting plot output to the appropriate format
(with C-g), and interpreting FORTRAN carriage control (the -f
option) is not currently done by the LP subsystem. While this
does not mean that you cannot print files from Solaris
systems, it does mean that for the time being you may have to
do a little extra work before sending the job to the printer.
% lp [-d dest] filename [filenames...]
In this command, filename is the name of the file you want to print, and dest is the name of the printer you want to print it on.
Printers under Solaris have the same names as they do on other ECN systems, so if you wanted to print your file on the Apple LaserWriter in room 104 of the MSEE building, you would issue the command
% lp -d msa filename
Unlike the lpr command, which makes a copy of the file before printing it, lp tries to print the file from its current location in your directory. This has some important implications:
If you edit the file after you have issued the lp
command, but before it gets sent to the printer, the
changes you make to the file will appear in the printed
copy.
If you delete the file before it gets sent to the
printer, it will not get printed at all.
If you print a file from a directory which the line
printer subsystem does not have access to due to file
permissions, you may receive an error message about the
file being inaccessible. If this occurs, you can give
the file to lp via the standard input, using a command
like:
% lp < filename
Generally, this change won't make much difference to you.
However, if you have problems printing a file because of this
change, you may wish to use the -c option to the lp command,
which tells it to make a copy of the file before printing it.
When lp submits a job to be printed, it will provide you with
a request id that you can use to refer to the job later. The
request id is made up of the printer name and a number which
increments with each print job. For example:
% lp -d msa program.c
request id is msa-65 (1 file(s))
psdit command first:
% troff -Tpsc -mmacros filename(s) | psdit | lp -d printer
dvips to the printer by simply saying
% lp dvips-output-file
psplot command first:
% psplot file | lp
lpstat command. There are two options to this command
that will be of use to you. The first option, -o, lets you
give the name of the printer queue you are interested in. For
example:
% lpstat -o msa
msa-65 davy 54 Feb 8 12:59 canceled
msa-66 davy 54 Feb 8 13:00 canceled
msa-67 davy 2546 Feb 8 13:05
This shows that there are three items in the queue: two of
them have been cancelled, and the other is being printed.
The second option, -p, lets you check on the status of the
printer itself. For example:
% lpstat -p msa
printer msa is idle. enabled since Tue Jan 26 18:20:03
EST 1993. available.
cancel command. This command takes the request ids given
to you by the lp command as arguments (you can also obtain the
request ids with the lpstat command described above). For
example:
% cancel msa-67
request "msa-67" cancelled
You can also cancel all of your print jobs at once by issuing
the command
% cancel -u yourlogin
This will cancel all your print jobs on all printers.
Bourne/Korn shell (.profile):LPDEST=msa export LPDESTC Shell (.cshrc):setenv LPDEST msa
lpr command with no printer
name specified (and no PRINTER variable set in your
environment), the output goes ``somewhere'' instead of giving
you an error message. At the present time, we have not
configured the Solaris systems with default printers (we will
do so at some undetermined future date). This means that, for
the time being, you must either always use the -d printername
option to the lp command, or you must set your LPDEST
environment variable.
% lpstat -p all
This will print a list of printers your system knows about. If
there is a printer that you use regularly that is not in the
list printed by lpstat, contact your site specialist to have
it added. It is not a problem to add a printer; we just don't
want to configure in support for 200-plus printers on every
Solaris system until we have worked out some of the technical
details involved in doing such a thing.