Change the printer you use on the command line or with the PRINTER environment variable.

If you want to use a different printer, there are several ways to do so. For changing the destination of a single print job, you can use a command-line option to lp or lpr . For example, if you use lpr, you can have the job sent to a different printer using the -P command-line option. To send a file called ch00.ps to a printer called ibis, type:

% lpr -Pibis ch00.ps

If you use the lp command, you can use the -d command-line option to specify a different printer. For example:

% lp -dibis ch00.ps

To change the default printer, use the PRINTER environment variable in your .cshrc or .profile file. (See Chapter 3 for more information on environment variables.) For example, to set the PRINTER variable to ibis in the .cshrcstartup file, include the line:

setenv PRINTER ibis

In the .profile file, the syntax is different:

PRINTER=ibis
export PRINTER

You can also change the default printer for just your current terminal session (and if you’re using multiple windows, for just that one window), by setting the PRINTER variable on the command line. For example, to change your default printer to ibis under the C shell, type:

% setenv PRINTER ibis

If you use the Bourne, Korn, or Bash shell (usually a $ prompt), type:

$ PRINTER=ibis
$ export PRINTER

All subsequent print jobs sent from that terminal session will use ibis as their default printer.

Get WYNTK: UNIX System Admininistrator now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.