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

FreeBSD Man Pages

Man Page or Keyword Search:
Man Architecture
Apropos Keyword Search (all sections) Output format
home | help
paste(1)			 User Commands			      paste(1)

NAME
       paste - merge corresponding or subsequent lines of files

SYNOPSIS
       paste [-s] [-d list] file...

DESCRIPTION
       The paste utility will concatenate the corresponding lines of the given
       input files, and	write the resulting lines to standard output.

       The default operation of	paste will concatenate the corresponding lines
       of the input files. The NEWLINE character of every line except the line
       from the	last input file	will be	replaced with a	TAB character.

       If an EOF (end-of-file) condition is detected  on  one  or  more	 input
       files, but not all input	files, paste will behave as though empty lines
       were read from the files	on which  EOF  was  detected,  unless  the  -s
       option is specified.

OPTIONS
       The following options are supported:

       -d list
	     Unless  a backslash character (\) appears in list,	each character
	     in	list is	an element specifying  a  delimiter  character.	 If  a
	     backslash	character appears in list, the backslash character and
	     one or more characters following it are an	element	 specifying  a
	     delimiter	character  as  described below.	These elements specify
	     one or more delimiters to use, instead of the default TAB charac-
	     ter,  to  replace	the  NEWLINE character of the input lines. The
	     elements in list are used circularly; that	is, when the  list  is
	     exhausted the first element from the list is reused.

	     When the -s option	is specified:

		o  The	last newline character in a file will not be modified.

		o  The delimiter will be reset to the first  element  of  list
		   after each file operand is processed.
       When the	option is not specified:

		o  The	NEWLINE	 characters  in	the file specified by the last
		   file	will not be modified.

		o  The delimiter will be reset to the first  element  of  list
		   each	time a line is processed from each file.
       If  a backslash character appears in list, it and the character follow-
       ing it will be used to represent	the following delimiter	characters:

	     \n	   Newline character.

	     \t	   Tab character.

	     \\	   Backslash character.

	     \0	   Empty string	(not a null character).	If \0  is  immediately
		   followed  by	the character x, the character X, or any char-
		   acter defined by the	LC_CTYPE digit	keyword,  the  results
		   are unspecified.

	     If	 any  other  characters	 follow	the backslash, the results are
	     unspecified.

       -s    Concatenate all of	the lines of each separate input file in  com-
	     mand  line	 order.	The NEWLINE character of every line except the
	     last line in each input file will be replaced with	the TAB	 char-
	     acter, unless otherwise specified by the -d option.

OPERANDS
       The following operand is	supported:

       file  A	path  name of an input file. If	- is specified for one or more
	     of	the files, the standard	input will be used; the	standard input
	     will be read one line at a	time, circularly, for each instance of
	     -.	Implementations	support	pasting	of at least 12 file  operands.

USAGE
       See  largefile(5)  for  the  description	 of the	behavior of paste when
       encountering files greater than or equal	to 2 Gbyte ( 2**31 bytes).

EXAMPLES
       Example 1: List a directory in one column.

	      ls | paste -d" " -

       Example 2: List a directory in four columns.

	      ls | paste - - - -

       Example 3: Combine pairs	of lines from a	file into single lines.

	      paste -s -d"\t\n"	file

ENVIRONMENT VARIABLES
       See environ(5) for descriptions of the following	environment  variables
       that affect the execution of paste: LC_CTYPE and	LC_MESSAGES.

EXIT STATUS
       The following exit values are returned:

       0     Successful	completion.

       >0    An	error occurred.

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       +-----------------------------+-----------------------------+
       |      ATTRIBUTE	TYPE	     |	    ATTRIBUTE VALUE	   |
       +-----------------------------+-----------------------------+
       |Availability		     |SUNWesu			   |
       +-----------------------------+-----------------------------+
       |CSI			     |Enabled			   |
       +-----------------------------+-----------------------------+

SEE ALSO
       cut(1), grep(1),	pr(1), attributes(5), environ(5), largefile(5)

DIAGNOSTICS
       "line too long"
	     Output lines are restricted to 511	characters.

       "too many files"
	     Except  for  -s option, no	more than 12 input files may be	speci-
	     fied.

       "no delimiters"
	     The -d option was specified with an empty list.

       "cannot open file"
	     The specified file	cannot be opened.

SunOS 5.9			  20 Dec 1996			      paste(1)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | USAGE | EXAMPLES | ENVIRONMENT VARIABLES | EXIT STATUS | ATTRIBUTES | SEE ALSO | DIAGNOSTICS

Want to link to this manual page? Use this URL:
<http://www.freebsd.org/cgi/man.cgi?query=paste&sektion=1&manpath=SunOS+5.9>

home | help