Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ pr(C) — OpenDesktop 1.0.0y

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cat(C)


     PR(C)                                      UNIX System V



     Name
          pr - prints files on the standard output


     Syntax
          pr [ options ] [ files ]


     Description
          pr prints the named files on the standard output.   If  file
          is  -,  or  if no files are specified, the standard input is
          assumed.  By default, the listing is separated  into  pages,
          each  headed by the page number, date and time, and the name
          of the file.

          By default, columns are of  equal  width,  separated  by  at
          least  one  space;  lines which do not fit are truncated. If
          the -s option is used, lines are not truncated  and  columns
          are separated by the separation character.

          If the standard output is associated with a terminal,  error
          messages are withheld until pr has completed printing.

          Options may appear singly or combined in any  order.   Their
          meanings are:

          +k      Begins printing with page k (default is 1).

          -k      Produces  k-column  output  (default  is  1).    The
                  options  -e  and  -i  are  assumed  for  multicolumn
                  output.

          -a      Prints multicolumn output across the page.

          -m      Merges and prints all files simultaneously, one  per
                  column (overrides the -k, and -a options).

          -d      Double-spaces the output.

          -eck    Expands  input  tabs  to  character  positions  k+1,
                  2*k+1, 3*k+1, etc.  If k is 0 or is omitted, default
                  tab settings at every 8th position are assumed.  Tab
                  characters  in  the  input  are  expanded  into  the
                  appropriate number of spaces.  If  c  (any  nondigit
                  character)  is given, it is treated as the input tab
                  character (default for c is the tab character).

          -ick    In output, replaces whitespace wherever possible  by
                  inserting  tabs  to  character positions k+1, 2*k+1,
                  3*k+1, etc.  If k is 0 or is  omitted,  default  tab
                  settings  at  every  8th position are assumed.  If c
                  (any nondigit character) is given, it is treated  as
                  the  output  tab character (default for c is the tab
                  character).

          -nck    Provides k-digit line numbering (default  for  k  is
                  5).   The  number  occupies  the first k+1 character
                  positions of each column of normal  output  or  each
                  line of -m output.  If c (any nondigit character) is
                  given, it is appended to the line number to separate
                  it from whatever follows (default for c is a tab).

          -wk     Sets the width of a line to  k  character  positions
                  (default  is  72 for equal-width multicolumn output,
                  no limit otherwise).

          -ok     Offsets each line by k character positions  (default
                  is  0).   The number of character positions per line
                  is the sum of the width and offset.

          -lk     Sets the length of a page to  k  lines  (default  is
                  66).

          -h      Uses the next argument as the header to  be  printed
                  instead of the filename.

          -p      Pauses before beginning each page if the  output  is
                  directed to a terminal (pr will ring the bell at the
                  terminal and wait for a carriage return).

          -f      Uses form feed character for new pages  (default  is
                  to  use  a  sequence  of  linefeeds).  Pauses before
                  beginning the first page if the standard  output  is
                  associated with a terminal.

          -r      Prints no diagnostic  reports  on  failure  to  open
                  files.

          -t      Prints neither the 5-line identifying header nor the
                  5-line  trailer  normally  supplied  for  each page.
                  Quits printing after the  last  line  of  each  file
                  without spacing to the end of the page.

          -sc     Separates columns by the single character c  instead
                  of  by the appropriate number of spaces (default for
                  c is a tab).

     Examples
          The following prints file1 and  file2  as  a  double-spaced,
          three-column listing headed by ``file list'':

               pr -3dh "file list" file1 file2

          The following writes  file1  on  file2,  expanding  tabs  to
          columns 10, 19, 28, 37, ... :

               pr -e9 -t <file1 >file2

     See Also
          cat(C)


     Standards Conformance
          pr is conformant with:

          AT&T SVID Issue 2, Select Code 307-127;
          and The X/Open Portability Guide II of January 1987.


     (printed 8/24/89)                                  PR(C)

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