- Printing in the lab will deduct money from your LabNet Print Account or your MUN Account. To add money to your MUN Account you can use the URL https://thor.aits.mun.ca/ or the machine in the library. To check to see how much money is available in your account for printing you can use LabNet Webtools.
- A partial list of LabNet printers includes the following:
Room No. Printer Names CS-1019 cs1019prt1, cs1019prt2 EN-1049 csaljet EN-2036 linuxlj CP-2003 cp2003prt1 Commons (in the Library) icomprt1, icomprt2 - In order to print a regular text file (e.g., program files and typescript files) from the Linux Shell prompt (e.g., ace $ ), you may use the a2ps command. This command formats the page with borders and includes some pertinent information about the file and user. The a2ps command has a number of options as follows:
-M letter converts the paper size to letter rather than the default A4.
-1 indicates to put one page of information to one sheet of paper, displayed in portrait mode.
-2 indicates to put two pages of information to one sheet of paper, displayed in landscape mode with a smaller font.
-E indicates to highlight the syntax of certain program files
-Pcs1019prt1 indicates to print to one of the printers in CS-1019; other printer names may be substituted for cs1019prt1.
So a complete command to print a file to the printer called cs1019prt1 in CS-1019 using a2ps, with syntax highlighting on letter paper, could be:
a2ps -M letter -1 -E -Pcs1019prt1 filename (for one page per sheet)
or
a2ps -M letter -2 -E -Pcs1019prt1 filename (for two pages per sheet)
Note: You must be in the directory which contains the file in order to print this way; otherwise you must specify the pathname for the file. Also if you are printing a typescript file, you may need to make sure that you type all commands/input in the script session perfectly so that there are no backspace characters in the file. If you use the backspace key during a script session, the typescript file may not print properly (depending on the printer used) and you may have to run the script session again.
You can get more help on the a2ps command witha2ps --help
. - Note that the lpr command (i.e., lpr -Pprintername filename) works at the command line prompt as well, but does not do the same formating as a2ps.
- A sample command-line session to create a typescript file of a Java program run and print it to cs1019prt1 using a2ps would be:
% PS1="% " SHELL="/bin/sh" script a1.txt # start the capture environment % cat GeneratePascalTriangle.java import java.io.PrintStream; /** * A program to produce the first 5 rows of Pascal's triangle. * * @author Rod Byrne */ public class GeneratePascalTriangle { /** * Prints Pascal's triangle to standard output. */ public static void main( String[] args ) { out.println(" 1"); out.println(" 1 1"); out.println(" 1 2 1"); out.println(" 1 3 3 1"); out.println("1 4 6 4 1"); } } % javac GeneratePascalTriangle.java # compile the file % java GeneratePascalTriangle # run the file 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 % exit Script done, file is a1.txt % a2ps -M letter -2 -E -Pcs1019prt1 a1.txt