Making paste command read from standard input Making paste command read from standard input shell shell

Making paste command read from standard input


Clearly, paste reads a line from the first 'file' (which is standard input), and then a line from the second 'file' (which is also standard input) and pastes them to create the first line of output. Then it repeats.

The POSIX specification for paste covers the point explicitly:

If '-' is specified for one or more of the files, the standard input shall be used; the standard input shall be read one line at a time, circularly, for each instance of '-'.


You could use "paste num num" to generate

1 12 23 34 4