Page 106 / 150 Scroll up to view Page 101 - 105
102
Unix/Linux Printing
Printing Text Files form Unix
Text files on Unix systems contain lines that end with “newline” characters, as
opposed to MS-DOS and Windows-related operating systems that end with a
carriage return followed by a linefeed. Most printers require a carriage
return/linefeed pair at the end of each line, making it necessary for some
translation to be done before Unix text files can be printed on most printers.
For this purpose, you can define two “printers” for the same printer port, one that
prints to the port itself, and one that prints to the port name with
_TEXT
added to
the name. Files printed to the second port will be translated so that the printer has
the carriage return/linefeed pairs that it needs.
For example, you could define a printer
hp5l
that prints to port
PS-142634-P1
,
and a printer
hp5lt
that prints to port
PS-142634-P1_TEXT
.
Your graphics files
could then be printed to the
hp5l
printer, and “raw” text files could be printed to
the
hp5lt
printer.
Page 107 / 150
103
Printing form BSD Unix Versions
For “flavors” of the Unix operating system derived from or related to the BSD
releases, such as SunOS 4.x, Linux, BSD/OS, FreeBSD, or NetBSD, you can use
the following procedure to enable users to print to a printer connected to your
D-LINK network print server:
1.
Log in as the superuser (root).
2.
Add an entry for the print server in the host’s
/etc/hosts
file, giving a hostname
for the print server’s IP address. A line in
/etc/hosts
contains an IP address
and one or more aliases for the host . For example:
202. 39. 74. 40
ps-142634
ps-142634.dlink.com.tw
If you use DNS (the Domain Naming Services protocol), you can add an address
record entry to your DNS database for the print server.
3.
Create a spool directory for the printer:
On SunOS systems, create the directory as a subdirectory of
/var/spool
,
with the same name as the printer (e.g.,
/var/spool/hp5l
).
On Linux systems, create the directory as a subdirectory of
/user/spool
/lp
.
On BSD/OS, FreeBSD, or NetBSD systems, create the directory as
subdirectory of
/var/spool
.
4.
Change the owner and permissions of the directory so that it is owned and
writable by group
daemon
, using the following commands:
Page 108 / 150
104
chown
bin.daemon /var/spool/hp5l
chmod
775 /var/spool/hp5l
5.
Add an entry for the printer to
/etc/printcap
, similar to the following:
hp5l:\
:lp=:sd=/var/spool/hp5l :mx#0:\
:rm=ps-142634:rp=ps-142634-p1:
The meaning of each of the entries is described below. The directory path in the
sd
spool directory entry should match the directory name you created above. If
your entry requires more than one line you can escape the newline with a
backslash.
6.
Issue the command
lpc
start
hp5l
to start a spool daemon for the printer. The printer will now be available for use.
7.
Optionally, add another printcap entry (and issue another
lpc start
command)
for a second printer, using the
port_TEXT
port. This second printer name can be
used for printing text files.
Entries in
/ect/printcap
begin with a name for the printer or a list of name,
separated by | (a vertical bar). The entries used above are:
lp=
The lp entry is used to specify a local printer device.
Since the printer is a remote printer, this entry should be blank.
Page 109 / 150
105
sd=dir
The location of the printer’s local spool directory.
mx#blocks
The limit for print job files in the local spool directory;
0 means no limit.
rm=address
The host where the remote printer is located, in this case
the D-Link print server.
rp=printer
The name of the printer on the remote host.
For the D-Link print server, the port name should be used.
Note: this entry is case-sensitive.
Page 110 / 150
106
Printing from SCO Unix System V/386
To allow printing to a printer attached to your D-LINK network print server from a
SCO Unix System V/386 host.
1.
Login as the superuser (root).
2.
Add an entry for the print server in the host’s
/etc/hosts
file, giving a hostname
for the print server’s IP address. A line in
/etc/hosts
contains an IP address
and one or more aliases for the host. For example:
202.39.74.40
ps-142634
ps-142634.dlink.com.tw
If you use DNS (the Domain Naming Services protocol), you can add an address
record entry to your DNS database for the print server.
3.
Change to the
/dev
directory, and issue the command
mkdev rlp
4.
The script will ask:
Do you want to install or delet remote printing (i/d/q)?
Answer
i
and press Enter to continue.
5.
The script will ask:
Do you want to change the remote printer description file
/etc/printcap (y/n)?
Answer y and press Enter to continue.
6.
The script will ask:
Please enter the printer name (q to quit):
Enter an alias for the printer on the local machine and press Enter. This name
should be the same as the destination port name.

Rate

3.5 / 5 based on 2 votes.

Bookmark Our Site

Press Ctrl + D to add this site to your favorites!

Share
Top