*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> paste (1)              
Title
Content
Arch
Section
 

Contents


paste(1)							      paste(1)


NAME    [Toc]    [Back]

     paste - merge same	lines of several files or subsequent lines of one file

SYNOPSIS    [Toc]    [Back]

     paste -|file1  -|file2  . . .
     paste -dlist <b>-|file1  -|file2  . .	.
     paste -s [-dlist] -|file1 . . .

DESCRIPTION    [Toc]    [Back]

     In	the first two forms, paste concatenates	corresponding lines of the
     given input files file1, file2, and so on.	 It treats each	file as	a
     column or columns of a table and pastes them together horizontally
     (parallel merging).  If you will, it is the counterpart of	cat(1) which
     concatenates vertically, that is, one file	after the other.  In the last
     form above, paste replaces	the function of	an older command with the same
     name by combining subsequent lines	of the input file (serial merging).
     If	more than one file is specified	with the -s option, paste(1)
     concatenates the merged files one below the other.	 In all	cases, lines
     are glued together	with the tab character,	or with	characters from	an
     optionally	specified list.	 Output	is to the standard output, so it can
     be	used as	the start of a pipe, or	as a filter, if	- is used in place of
     a file name.  paste processes supplementary code set characters in	files,
     and recognizes supplementary code set characters in the list given	to the
     -d	option (see below) according to	the locale specified in	the LC_CTYPE
     environment variable [see LANG on environ(5)].

     The meanings of the options are:

     -d	  Without this option, the new-line characters of each but the last
	  file (or last	line in	case of	the -s option) are replaced by a tab
	  character.  This option allows replacing the tab character by	one or
	  more alternate characters (see below).

     list One or more characters immediately following -d replace the default
	  tab as the line concatenation	character.  The	list is	used
	  sequentially and circularly: first, the first	element	on the list is
	  used to concatenate the lines, then the next,	and so on; when	all
	  elements have	been used, the list is reused starting from the	first
	  element.  In parallel	merging	(that is, no -s	option), the lines
	  from the last	file are always	terminated with	a new-line character,
	  not from the list.  The list may contain the special escape
	  sequences:  \n (new-line), \t	(tab), \\ (backslash), and \0 (empty
	  string, not a	null character).  Quoting may be necessary, if
	  characters have special meaning to the shell (for example, to	get
	  one backslash, use -d"\\\\" ).  list may contain supplementary code
	  set characters.

     -s	  Merge	subsequent lines rather	than one from each input file.	Use
	  tab for concatenation, unless	a list is specified with -d option.
	  Regardless of	the list, the very last	character of the file is
	  forced to be a new-line.




									Page 1






paste(1)							      paste(1)



     -	  May be used in place of any file name, to read a line	from the
	  standard input.  (There is no	prompting).

EXAMPLES    [Toc]    [Back]

     ls	| paste	-d" " -
		    Lists directory in one column

     ls	| paste	- - - -
		    Lists directory in four columns

     paste -d"\t\n" file1 file2
		    Lists file1	in column 1 and	file2 in column	2.  The
		    columns are	separated by a tab.

     paste -s -d"\t\n" file1 file2
		    Merges pairs of subsequent lines first in file1, then in
		    file2.  Concatenates the merged file2 below	file1.

FILES    [Toc]    [Back]

     /usr/lib/locale/locale<b>/LC_MESSAGES/uxdfm
	  language-specific message file [See LANG on environ(5).]

SEE ALSO    [Toc]    [Back]

      
      
     cut(1), grep(1), pr(1)

DIAGNOSTICS    [Toc]    [Back]

     UX:paste:ERROR:line too long
	  Output lines are restricted to 4096 bytes.

     UX:paste:ERROR:too	many files
	  Except for -s	option,	no more	than 12	input files may	be specified.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
paste OpenBSD merge corresponding or subsequent lines of files
paste FreeBSD merge corresponding or subsequent lines of files
paste Tru64 Joins corresponding lines of several files or subsequent lines in one file
paste Linux merge lines of files
join Tru64 Joins the lines of two files
nl Linux number lines of files
head OpenBSD display first few lines of files
sort Linux sort lines of text files
sort FreeBSD sort lines of text files
comm OpenBSD select or reject lines common to two files
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service