Designating the default printer

Warren Block wblock at wonkity.com
Tue May 6 17:08:14 PDT 2003


On Tue, 6 May 2003, Len Zettel wrote:

> This is my /etc/printcap file.
>
> Laserjet|hp|Hewlett Packard Laserjet 1100:\
> 	:sh:sd=/var/spool/lpd/Laserjet:\
> 	:lp=/dev/lpt0:\
> 	:if=/usr/local/libexec/if-simple:

> Following Unix Power Tools 43.04, p 790, entering
> PRINTER=Laserjet ; export PRINTER
> from a console lets me do
> lpr foo
> file foo is printed as above.
>
> Question: What do I put where to specify Laserjet as
> the default printer as part of the boot sequence?

Normally, the default printer has a name of "lp", so you could add that
to your /etc/printcap entry by changing the first line to look like
this:

lp|Laserjet|hp|Hewlett Packard Laserjet 1100:\

But if you want to change the PRINTER variable, you'd do that in the
startup script for your shell.  The details vary depending on the shell
you're using; from the variable-setting line you showed, it looks like
you're using BASH.  So you'd put it in one of the BASH shell startup
scripts.  I don't know which one is most appropriate; I always used
.profile (back when I used BASH).

-Warren Block * Rapid City, South Dakota USA


More information about the freebsd-questions mailing list