1paste(1)                         User Commands                        paste(1)
2
3
4

NAME

6       paste - merge corresponding or subsequent lines of files
7

SYNOPSIS

9       paste [-s] [-d list] file...
10
11

DESCRIPTION

13       The paste utility will concatenate the corresponding lines of the given
14       input files, and write the resulting lines to standard output.
15
16
17       The default operation of paste will concatenate the corresponding lines
18       of the input files. The NEWLINE character of every line except the line
19       from the last input file will be replaced with a TAB character.
20
21
22       If an EOF (end-of-file) condition is detected  on  one  or  more  input
23       files, but not all input files, paste will behave as though empty lines
24       were read from the files on which  EOF  was  detected,  unless  the  -s
25       option is specified.
26

OPTIONS

28       The following options are supported:
29
30       -d list     Unless  a  backslash  character  (\)  appears in list, each
31                   character in list is  an  element  specifying  a  delimiter
32                   character.  If  a  backslash character appears in list, the
33                   backslash character and one or more characters following it
34                   are   an   element  specifying  a  delimiter  character  as
35                   described below. These elements specify one or more  delim‐
36                   iters  to  use,  instead  of  the default TAB character, to
37                   replace the NEWLINE character of the input lines. The  ele‐
38                   ments  in  list are used circularly. That is, when the list
39                   is exhausted, the first element from the list is reused.
40
41                   When the -s option is specified:
42
43                       o      The last newline character in a file will not be
44                              modified.
45
46                       o      The delimiter will be reset to the first element
47                              of list after each file operand is processed.
48                   When the option is not specified:
49
50                       o      The NEWLINE characters in the file specified  by
51                              the last file will not be modified.
52
53                       o      The delimiter will be reset to the first element
54                              of list each time a line is processed from  each
55                              file.
56                   If  a backslash character appears in list, it and the char‐
57                   acter following it will be used to represent the  following
58                   delimiter characters:
59
60                   \n       Newline character.
61
62
63                   \t       Tab character.
64
65
66                   \\       Backslash character.
67
68
69                   \0       Empty  string  (not  a  null  character). If \0 is
70                            immediately followed by the character x, the char‐
71                            acter  X, or any character defined by the LC_CTYPE
72                            digit keyword, the results are unspecified.
73
74                   If any other characters follow the backslash,  the  results
75                   are unspecified.
76
77
78       -s          Concatenate all of the lines of each separate input file in
79                   command line order. The NEWLINE  character  of  every  line
80                   except  the  last  line in each input file will be replaced
81                   with the TAB character, unless otherwise specified  by  the
82                   -d option.
83
84

OPERANDS

86       The following operand is supported:
87
88       file     A  path  name  of  an input file. If is specified for one or
89                more of the files, the standard input will be used. The  stan‐
90                dard  input  will  be read one line at a time, circularly, for
91                each instance of .  Implementations  support  pasting  of  at
92                least 12 file operands.
93
94

USAGE

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

EXAMPLES

100       Example 1 Listing a directory in one column
101
102         example% ls | paste -d" " −
103
104
105
106       Example 2 Listing a directory in four columns
107
108         example% ls | paste − − − −
109
110
111
112       Example 3 Combining pairs of lines from a file into single lines
113
114         example% paste -s -d"\ t\ n" file
115
116
117

ENVIRONMENT VARIABLES

119       See environ(5) for descriptions of the following environment  variables
120       that  affect  the  execution  of paste: LANG, LC_ALL, LC_CTYPE, LC_MES‐
121       SAGES, and NLSPATH.
122

EXIT STATUS

124       The following exit values are returned:
125
126       0      Successful completion.
127
128
129       >0     An error occurred.
130
131

ATTRIBUTES

133       See attributes(5) for descriptions of the following attributes:
134
135
136
137
138       ┌─────────────────────────────┬─────────────────────────────┐
139       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
140       ├─────────────────────────────┼─────────────────────────────┤
141       │Availability                 │SUNWesu                      │
142       ├─────────────────────────────┼─────────────────────────────┤
143       │CSI                          │Enabled                      │
144       ├─────────────────────────────┼─────────────────────────────┤
145       │Interface Stability          │Standard                     │
146       └─────────────────────────────┴─────────────────────────────┘
147

SEE ALSO

149       cut(1), grep(1), pr(1), attributes(5), environ(5), largefile(5),  stan‐
150       dards(5)
151

DIAGNOSTICS

153       "line too long"       Output lines are restricted to 511 characters.
154
155
156       "too many files"      Except for -s option, no more than 12 input files
157                             may be specified.
158
159
160       "no delimiters"       The -d option was specified with an empty list.
161
162
163       "cannot open file"    The specified file cannot be opened.
164
165
166
167
168SunOS 5.11                        20 Dec 1996                         paste(1)
Impressum