Announcement

Collapse
No announcement yet.

Paste command syntax

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Paste command syntax

    I am hung up on what seems like a really simple problem. If I want to paste three text files of equal length together, typing

    paste file1 file2 file3

    gives me the output I want, in a tab-delimited file. So far, so good. But if I want to use a space as the delimiter instead of a tab, my (clearly) incorrect understanding is that I should type
    paste -d\ file1 file2 file3

    The -d says I'm going to specify a different delimiter from the default (tab). The backslash says that the character immediately following the backslash loses its special meaning to the shell. The second space, as I understand it, should be telling the shell that the arguments are coming. But when I run the command, the contents of file1 are replaced with a space, and files 2 and 3 are properly printed, separated by a space. So what do I need to do to have the output include file1?

    Many thanks.

    #2
    try

    Code:
    paste -d ' ' file1 file2 file3

    Comment

    Working...
    X