All the Unix That's Fit to Print
Bama is connected through the campus network to a small variety of printers. More can be setup at the request of users. Contact the Help Desk for more information about adding printers. In addition, we have created a special type of printer setup called "desktop" that can turn any printer attached to your own PC into a Bama printer. Before we get into that detail, let's start with basic printing, though.
The print command on Bama is " lp" (think of "line printer"). Almost any file can be printed with the command
lp myfile
where myfile is the actual name of the file to be printed. The exception to this would be binary files, which have no meaning as printout and usually waste reams of paper. In this command we haven't actually told Bama where to print the file. That information is hidden in your setup in an environment variable called LPDEST (see Tipsheet Vol. 1, No. 3). The current valid values for LPDEST are "3827", "afccu2", "desktop", and "desktopps". The value of LPDEST can be overridden in the "lp" command by using the "-d" option, as in:
lp -d afccu2 myfile
LPDEST is set, by default to a printer in the computer room at Gordon Palmer Hall called "3827". To pickup output from this printer you should go to Rm 127 Gordon Palmer and check in the alphabetized bins along the wall. This printer is very fast and is most useful for printing out plain text files. Occasionally, you will create a printer file with some special program that creates Postscript or PCL output. These should not be sent to the 3827.
If you do create Postscript or PCL output, then a reasonable choice of printers is afccu2. Output from this is also picked up in Rm. 127 Gordon Palmer. There are several types of programs that might create a Postscript file. A graphics program would be one example. There are several other generally useful programs on Bama that create Postscript. One of these is "filep". It produces a nicely formatted printout with the users name at the top and the file name at the bottom. This command is very useful for organizing your work. To use it type
filep -Pafccu2 myfile
Note that it names the printer with the "-P" option instead of "-d". This command is a leftover from the old Sun operating system where the print command always used "-P".
A related program is "mailp". It is smart enough to read a mail message header and pull out the subject. It puts this information at the bottom of the page. It is quite useful as a printer option inside of Pine. To set it up within Pine, from the main menu of Pine press "s" for setup and "p" for printer. Move down the page with the down arrow until "Personally selected print command is highlighted. Then press "a" to add a printer. It will ask for the printer name. Give the printer a short descriptive name, such as "mailp", then press return. Next it will ask for the printer command. Enter "mailp -Pafccu2" and press return. Note, that another appropriate printer can be substituted for "afccu2" if one is added to Bama in the future. Now press return one more time and "mailp" will become your default printer for printing mail from Pine.
The third helpful program is "nenscript". It will format plain text files into Postscript and can add some extra information. By default it puts a header on each page with the file name and the date and time. It's biggest advantages, however, are that it will let you turn the printout sideways on the page (landscape mode) and change the type size. If you have output that is wider than the page you can turn it to landscape. By reducing the size of the print you can fit more on a page. Its biggest disadvantage at the moment is that it will only produce output in Courier typeface. To use "nenscript" to rotate a page and reduce type you could use:
nenscript -r -fCourier8 -d afccu2 myfile
You may substitute "Courier-Bold" for "Courier" and some other type size rather than 8pt type as in the example.
Mailp, filep and nenscript have other options, such as to enable printing in two columns, which you might like to explore. Use "man mailp", etc, to read more about them.
The final two options are "desktop" and "desktopps". Desktop will print plain text files to any printer attached to the PC you are using to access Bama. The only requirement to make this work is that you use a telnet program smart enough to handle the special codes that are sent to start the printer. The generic Windows 95 telnet will not work. You must get a better version. We are recommending TeraTerm. It is freeware and is available from the computer center software download site at
http://www.ua.edu/~seebeck/software
(Editor's Note: The Software Download Library is now located at http://ncs.ua.edu/software)
Versions for Win95 and Win3.1 are both available. When you are connect through TeraTerm then a print command of the form
lp -d desktop myfile
will transfer the file through the telnet program to your own printer driver on your PC. The printer dialog box should pop-up, allowing you to change characteristics, such as going to landscape from portrait mode. If you are printing a long file, it may take several seconds to transfer.
If you have a Postscript printer attached to your PC you can use the "desktopps" option. There is one setup change required for TeraTerm to make this work. You must turn off the printer margins in the TeraTerm configuration file. To do this:
- Go to the teraterm directory on your PC. A likely place is under "Program Files\Ttermpro".
- Double click the mouse on the "teraterm" configuration settings file. This will open the file using Notepad so that you can edit it.
- Under the "Search" menu in Notepad select the Find option. (use left mouse button to open menu)
- Where it says "Find what" enter "PrnMargin" and click the "Find Next button.
- Change the line that is found from "PrnMargin 50,50,50,50" to "PrnMargin 0,0,0,0".
- Save the changed file (select "Save" under the Notepad "File" menu) and exit Notepad.
You also must set your printer driver type to be "Generic/Text Only". You probably will need to install this printer type. Now, if you have produced a postscript file that is reasonably short you may print it with
lp -d desktopps myfile
Since it does pass the file through the telnet program, this option will refuse to print large files. Allowing large files to pass through could cause large delays (10's of minutes if you are working through a modem). Postscript files can get to be several megabytes in size.
© 1998, The University of Alabama. The information included here is for the University of Alabama central computing facility as it was configured on the document date. It may or may not apply to other Unix systems.

