Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ lpr(1) — NEWS-os 4.1C

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

lpq(1)

lprm(1)

pr(1)

a3sjlbp(1)

symlink(2)

printcap(5)

lpc(8)

lpd(8)

lbp_filters(8)

LPR(1)  —  NEWS-OS Programmer’s Manual

NAME

lpr − off line print

SYNOPSIS

lpr [ −Pprinter ] [ −#num ] [ −bopt ] [ −C class ] [ −J job ] [ −T title ] [ −i [ numcols ]] [ −1234 font ] [ −wnum ] [ −pltndgvcfxermhsjUX ] [ −S [ ascii ]] [ name ...  ]

DESCRIPTION

Lpr uses a spooling daemon to print the named files when facilities become available.  If no names appear, the standard input is assumed.  The −P option may be used to force output to a specific printer.  Normally, the default printer is used (site dependent), or the value of the environment variable PRINTER is used. 

 
lpr converts text file from system code to printer code automatically.  The environment variable LC_CTYPE or LANG specifies the system code.  The code type of printer is described in ct entry of the printer capabilities data base, /etc/printcap.  See the section MULTI LANGUAGE SUPPORT for more details on  auto code conversion function

The following single letter options are used to notify the line printer spooler that the files are not standard text files. The spooling daemon will use the appropriate filters to print the data accordingly. 

−pUse pr(1) to format the files (equivalent to print).

−lUse a filter which allows control characters to be printed and suppresses page breaks. 

−tThe files are assumed to contain data from troff(1) (cat phototypesetter commands).

−nThe files are assumed to contain data from ditroff (device independent troff). 

−dThe files are assumed to contain data from tex(l) (DVI format from Stanford).

−gThe files are assumed to contain standard plot data as produced by the plot(3X) routines (see also plot(1G) for the filters used by the printer spooler).

−vThe files are assumed to contain a raster image for devices like the Benson Varian. 

−cThe files are assumed to contain data produced by CDIF (Common Document Intermediate Format). 

−fUse a filter which interprets the first character of each line as a standard FORTRAN carriage control character. 

−xThe files are assumed to contain data produced by xwd(n).

−eThe files are assumed to contain data of LBP-8 emulator. 

−S[ascii]
Use special filter. For example, −Sf designates the filter that is expressed as "Sf" in /etc/printcap.

The remaining single letter options have the following meaning. 

−rRemove the file upon completion of spooling or upon completion of printing (with the −s option). 

−mSend mail upon completion. 

−hSuppress the printing of the burst page. 

−sUse symbolic links.  Usually files are copied to the spool directory. 

−jPut the job identifier to stdout if the request is successfully accepted. The job identifier can be used with lpq(1), lprm(1). 

−USuppress auto code conversion.  Usually lpr converts text file from system code to printer code. 

−XForce auto code conversion.  This flag makes lpr to treat files as texts. 

The −C option takes the following argument as a job classification for use on the burst page.  For example,

lpr −C EECS foo.c

causes the system name (the name returned by hostname(1)) to be replaced on the burst page by EECS, and the file foo.c to be printed.

The −J option takes the following argument as the job name to print on the burst page.  Normally, the first file’s name is used. 

The −T option uses the next argument as the title used by pr(1) instead of the file name.

To get multiple copies of output, use the −#num option, where num is the number of copies desired of each file named.  For example,

lpr −#3 foo.c bar.c more.c

would result in 3 copies of the file foo.c, followed by 3 copies of the file bar.c, etc.  On the other hand,

cat foo.c bar.c more.c | lpr −#3

will give three copies of the concatenation of the files. 

The −bopt option specifies the optional argument to the printer filter.  Multiple −bopt options are possible.  In addition to the arguments generated by lpd(8), this option is passed to the printer filter without any modifications.  How to interpret this option depends on specification of each printer filter. 
The opt which starts with character ’:’(colon) is reserved by NEWS-OS to specify the function of LBP. 
Neither space characters nor carriage returns can be included in opt. 

The −i option causes the output to be indented. If the next argument is numeric, it is used as the number of blanks to be printed before each line; otherwise, 8 characters are printed. 

The −w option takes the immediately following number to be the page width for pr.

The −s option will use symlink(2) to link data files rather than trying to copy them so large files can be printed.  This means the files should not be modified or removed until they have been printed.

The option −1234 Specifies a font to be mounted on font position i.  The daemon will construct a .railmag file referencing /usr/lib/vfont/name.size. 

MULTI LANGUAGE SUPPORT

lpr converts text file from system code to printer code as TABLE I.  The environment variable LC_CTYPE or LANG specifies system code.  The code type of printer is described in ct entry of the /etc/printcap.  The value of ct entry is one of the followings; "C", "ja_JP.SJIS", "ja_JP.EUC", "ko_KR.EUC", "zh_TW.TCA", "en_US.88591" or "news".  lpr converts text file to 7 bit code based on ISO 2022 when  ct entry is "C" or "news", or when system code and printer code (except Japanese) differs.  For Japanese 8 bit text code, conversion is made between Japanese EUC and Shift-JIS code.  When no pinter code is specified, lpr dose not convert code. 

TABLE I: CONVERSION TABLE

System code Printer code Conversion
_ _ _
"ja_JP.EUC" "ja_JP.SJIS" to Shift-JIS
"ja_JP.SJIS" or "C" "ja_JP.EUC" to Japanese EUC
XXX "news" or "C" to 7bit code (ISO 2022)
XXX not specified no conversion
XXX same as system code no conversion
XXX different from system code to 7bit code (ISO 2022)

XXX is either "C", "ja_JP.SJIS", "ja_JP.EUC", "ko_KR.EUC", "zh_TW.TCA" or "en_US.88591". 

−U flag suppresses auto code conversion.  With −X flag the conversion is made on non-text file as well. 

lpr detects file type from options used to specify the filter, see TABLE II. 

TABLE II: File Type

Plain Text File:

option filter file type
_ _ _
none if(of) regular text
−p pr|if(of) regular text + pr(1)
−f rf Output of Fortran ( f77(1) )

Non-Text File:

option filter file type
_ _ _
−x xf xwd(1) image data
−c cf cdif(5) file
−d df TeX DVI file
−g gf plot(3) file
−n nf Output of ditroff(1)
−t tf Output of troff(1)
−v vf raster image data
−S[a] S[a] (special filter defined by user)
−e ef (LBP8 emulator)

CONVERSION CODE

lpr uses the following escape sequences on conversion to 7bit code based on ISO 2022. 

Under the Japanese EUC, Korean EUC or Chinese (Taiwan TCA) environment:

to Japanese Kanji, JIS X 0208-1983 ESC $ B
to Japanese Kana, JIS X 0201-1976 ESC ( I
to Korean, KS C5601-1987 ESC $ ( C
to Chinese, Taiwan CNS-11646-86 ESC $ ( 0
ESC $ ( 1
(†) ESC $ ( ?
to ASCII, ANSI X3.4-1986 ESC ( B

(†) this occupies one of user recordable code sets.

Under the European(ISO 8859-1) environment:

to Latin code, ISO 8859-1 ESC − A LS1
to ASCII, ANSI X3.4-1986 ESC ( B LS0

Under the Shift-JIS environment:

to Japanese Kanji, JIS C 6226-1983 ESC $ B
to JIS Roman ,JIS X 0201-1976 ESC ( J
to Japanese Kana, JIS X 0201-1976 ESC ( I

COMPATIBILITY

When using a printer (NWP-533/537/543) which is connected to the workstation (NEWS-OS Release 4.0 has been installed) under multiple language environment, specify as ct=news in the /etc/printcap, so that standard "if" filter can handle 7 bit code system based on ISO 2022. 
 
When using a printer other than NWP-533/537/543, specify ct entry to the code type specific to the printer. 
 
 
When Clients are under NEWS-OS Release 4.0 and Server is under NEWS-OS Release 3.X:

specify ct=ja_JP.SJIS in the client’s /etc/printcap file. 

When Clients are under NEWS-OS Release 3.X and Server is under NEWS-OS Release 4.0:

specify the /etc/printcap so that Shift-JIS code can be handled in the server workstation.  When using a printer (NWP-533/537/543) specify if=/usr/sony/lib/lpf_sjlbp in the server’s /etc/printcap. 

In NEWS-OS Release 3.X printer code is assumed to be Shift-JIS. 

ENVIRONMENT VARIABLE

LPRdefault flags, scanned before command line.
PRINTERdefault printer.
LC_CTYPEsystem code type.
LANGsystem code type, if no LC_CTYPE presents.

FILES

/etc/passwdpersonal identification
/etc/printcapprinter capabilities data base
/usr/lib/lpd∗line printer daemons
/usr/spool/∗directories used for spooling
/usr/spool/∗/cf∗daemon control files
/usr/spool/∗/df∗data files specified in "cf" files
/usr/spool/∗/tf∗temporary copies of "cf" files

SEE ALSO

lpq(1), lprm(1), pr(1), a3sjlbp(1), symlink(2), printcap(5), lpc(8), lpd(8), lbp_filters(8)

DIAGNOSTICS

If you try to spool too large a file, it will be truncated.  Lpr will object to printing binary files.  If a user other than root prints a file and spooling is disabled, lpr will print a message saying so and will not put jobs in the queue.  If a connection to lpd on the local machine cannot be made, lpr will say that the daemon cannot be started.  Diagnostics may be printed in the daemon’s log file regarding missing spool files by lpd.

BUGS

Auto code conversion can’t work with −s flag.  Fonts for troff and tex reside on the host with the printer. It is currently not possible to use local font libraries. 
 

NEWS-OSRelease 4.1C

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026