Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
PR(1V)									PR(1V)

NAME
       pr - prepare file(s) for	printing, perhaps in multiple columns

SYNOPSIS
       pr [ -|+	n ] [ -fmt ] [ -h string ] [ -ln ] [ -sc ]
	    [ -wn ] [ filename ] ...

SYSTEM V SYNOPSIS
       /usr/5bin/pr [ -|+ n ] [	-adfmprt ] [ -eck ]
	    [ -h string	] [ -ick ] [ -ln ] [ -nck ]
	    [ -on ] [ -sc ] [ -wn ] [ filename ] ...

AVAILABILITY
       The  System  V  version	of this	command	is available with the System V
       software	installation option.  Refer to for information on how  to  in-
       stall optional software.

DESCRIPTION
       pr prepares one or more filenames for printing.	By default, the	output
       is separated into pages headed by a date, the name of the file, and the
       page number.  pr	prints its standard input if there are no filename ar-
       guments.	 FORMFEED characters in	the input files	cause page  breaks  in
       the output, as expected.

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

       Inter-terminal messages using write(1) are forbidden during a pr.

OPTIONS
       Options apply to	all following filenames	but may	be reset between file-
       names:

       -f     Use  FORMFEED  characters	instead	of NEWLINE characters to sepa-
	      rate pages.  A FORMFEED is assumed to use	up two blank lines  at
	      the  top of a page.  Thus	this option does not affect the	effec-
	      tive page	length.

       -m     Print all	filenames simultaneously, each in one column, for  ex-
	      ample:
		     Print  PrintThe
		     the    thethird
		     lines  linesfile's
		     of	    oflines
		     file   filego
		     one.   two.here.

       -t     Do  not  print  the 5-line header	or the 5-line trailer normally
	      supplied for each	page.  Pages are not separated when  this  op-
	      tion  is used, even if the -f option was used.  The -t option is
	      intended for applications	where the results should  be  directed
	      to a file	for further processing.

       -h string
	      Use string, instead of the file name, in the page	header.

       -ln    Take the length of the page to be	n lines	instead	of the default
	      66.

       -sc    Separate columns by the single character c instead of by the ap-
	      propriate	 amount	 of white space.  A missing c is taken to be a
	      TAB.

       -wn    For multicolumn output, take the width of	the page to be n char-
	      acters instead of	the default 72.

       -n     Produce n-column output.	For example:
		     Print  ofin
		     the    onethree
		     lines  filecolumns.

	      Columns  are  not	 balanced;  if,	for example, there are as many
	      lines in the file	as there are lines on the page,	only one  col-
	      umn will be printed.  Even if the	-t option (see below) is spec-
	      ified, blank lines will be printed at the	end of the  output  to
	      pad it to	a full page.

       +n     Begin printing with page n.

SYSTEM V OPTIONS
       When  the  -n  option  is specified for multicolumn output, columns are
       balanced. For example, if there are as many lines in the	file as	 there
       are lines to be printed,	and two	columns	are to be printed, each	column
       will contain half the lines of the file.	 If the	-t  option  is	speci-
       fied, no	blank lines will be printed to pad the last page.

       The  options  -e	and -i are assumed for multicolumn output.  The	-m op-
       tion overrides the -k and -a options.

       The -f option does not assume that FORMFEED uses	up  two	 blank	lines;
       blank  lines  will  be printed after the	FORMFEED if necessary.	If the
       standard	output is a terminal, -f will cause pr to wait	for  a	RETURN
       before printing the first page.

	      -a     When  combined with the -n	option,	print multicolumn out-
		     put across	the page.  For example:
			    Print  thelines
			    of	   onefile
			    in	   threecolumns.

	      -d     Double-space the output.

	      -p     Pause before beginning each page if  the  output  is  di-
		     rected to a terminal (pr will ring	the bell at the	termi-
		     nal and wait for a	RETURN).

	      -r     Do	Not print diagnostic  reports  if  a  file  cannot  be
		     opened, or	if it is empty.

	      -eck   Expand  input  TAB	characters to character	positions k+1,
		     2*k+1, 3*k+1, etc.	 If k is 0 or is omitted, default  TAB
		     settings at every eighth position are assumed.  TAB char-
		     acters in the input are  expanded	into  the  appropriate
		     number  of	SPACE characters.  If c	(any non-digit charac-
		     ter) is given, it is treated as the input	TAB  character
		     (default for c is the TAB character).

	      -ick   In	 output,  replace white	space wherever possible	by in-
		     serting TAB characters to character positions k+1,	2*k+1,
		     3*k+1,  etc.   If	k is 0 or is omitted, default TAB set-
		     tings at every eighth position are	assumed.   If  c  (any
		     non-digit	character) is given, it	is treated as the out-
		     put TAB (default for c is the TAB character).

	      -nck   Provide 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 non-digit character) is given, it is appended	to the
		     line number to separate it	from whatever follows (default
		     for c is a	TAB).

	      -ok    Offset each line by k character positions.	 The number of
		     character positions per line is the sum of	the width  and
		     offset.

EXAMPLES
       Print  a	file called dreadnought	on the printer -- this is the simplest
       use of pr:
	      example% pr dreadnought |	lpr
	      example%

       Produce three laminations of a file called ridings side by side in  the
       output,	with no	headers	or trailers, the results to appear in the file
       called Yorkshire:
	      example% pr -m -t	ridings	ridings	ridings	> Yorkshire
	      example%

FILES
       /dev/tty*	   to suspend messages.

SEE ALSO
       cat(1V),	lpr(1),	write(1)

DIAGNOSTICS
       can't print 0 cols, using 1 instead.
	      -0 was specified as a -n option.

       pr: bad key key
	      An illegal option	was given.

       pr: No room for columns.
	      The number of columns requested will not fit on the page.

       pr: Too many args
	      More than	10 files were specified	with the -m option.

       filename	: error
	      filename could not be opened.  This diagnostic is	not printed if
	      pr is printing on	a terminal.

SYSTEM V DIAGNOSTICS
       pr: bad option
	      An illegal option	was given.

       pr: width too small
	      The number of columns requested will not fit on the page.

       pr: too many files
	      More than	10 files were specified	with the -m option.

       pr: page-buffer overflow
	      The formatting required is more complicated than pr can handle.

       pr: out of space
	      pr could not allocate a buffer it	required.

       pr: filename-- empty file
	      filename	was  empty.   This diagnostic is printed after all the
	      files are	printed	if pr is printing on a terminal.

       pr: can't open filename
	      filename could not be opened.  This diagnostic is	printed	 after
	      all the files are	printed	if pr is printing on a terminal.

BUGS
       The  options described above interact with each other in	strange	and as
       yet to be defined ways.

			       9 September 1987				PR(1V)

NAME | SYNOPSIS | SYSTEM V SYNOPSIS | AVAILABILITY | DESCRIPTION | OPTIONS | SYSTEM V OPTIONS | EXAMPLES | FILES | SEE ALSO | DIAGNOSTICS | SYSTEM V DIAGNOSTICS | BUGS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=pr&sektion=1v&manpath=SunOS+4.1.3>

home | help